Setting up security and pre-production settings on a new LEMP (one-click app)

Posted September 4, 2014 3.2k views

Sorry about my noob question.
I am setting up a new droplet for my new site and I want to know how to set things up securely and also the required setting before I go to production with a sample “Hello page”.
Can you please confirm and add some other things for my list.
Here are the steps that I got to do:

  1. Do the LEMP one-click app
  2. Go through initial server setup
  3. securing the server by implementing fail2ban (I have problem with this because my IP is dynamic and I can’t user this i think?)
  4. key-based authentication
  5. installing a firewall?(will this block my IP since my IP is dynamic?
  6. pointing a domain to my server home directory?

Basically I want to know what is necessary to be done before I create my first “hello world” page (php)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Sounds like you’re on the right path. Regarding fail2ban, you shouldn’t have any problems with the dynamic IP under the default settings. While you won’t be able to easily whitelist your IP, it only bans an IP after a number of failed login attempts. So especially if you are using key-based authentication, you shouldn’t have a problem.

Like with fail2ban, using a dynamic IP limits some of the things you could do with a firewall, but it will not prevent you from using it. You can still set up general rules, you just won’t be able to whitelist a specific IP. This article should get you up and running:

How To Setup a Firewall with UFW on an Ubuntu and Debian Cloud Server

Let us know how it goes!

by Shaun Lewis
Learn how to setup a firewall with UFW on an Ubuntu / Debian cloud server.
  • I did:

    1. Do the LEMP one-click app
    2. Go through initial server setup before going through fail2ban, I found out that I have to run mysql_secure_installation. then after that, I tried to access mysql and it worked fine using the root username for mysql. Do I need to create another user for mysql other than the root?(like I did for my server login)