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

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)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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!