Hi there,
I’m trying to set up a secure, high performance server for sites that I can configure in a step-by-step manner. Here’s the goal:
I’ve dabbled in server stuff in the past, but it’s not my forte and I’d rather follow the guidance of a pro than risk missing details or deploying something unstable/unsafe.
Thanks in advance!
Best, Phil
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!
Hello,
I’ll try to cover all of the services that you’ve mentioned. Let’s dive in:
1. DigitalOcean Droplet Creation:
2. Initial Server Configuration:
Connect to your droplet through SSH using the Terminal on your Mac once it’s active.
Update the system with these commands:
sudo apt update sudo apt upgrade
Create a non-root user with sudo access:
adduser your_username
usermod -aG sudo your_username
Logout as root, and login as the new user:
su - your_username
3. Installing the LEMP Stack:
Nginx: sudo apt install nginx
MariaDB: sudo apt install mariadb-server then sudo mysql_secure_installation
PHP and needed modules:
sudo apt install php-fpm php-mysql php-curl php-gd php-intl php-mbstring php-xml php-xmlrpc php-zip
4. Nginx Configuration for Drupal:
sudo nano /etc/nginx/sites-available/your_domainsudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
5. SSL Certificate Management:
sudo apt install certbotsudo certbot certonly --nginx -d your_domain -d www.your_domainsudo nginx -t
sudo systemctl restart nginx
6. Drupal Installation:
sudo chown -R www-data: /var/www/your_domain/sudo mysql -u root -p
CREATE DATABASE drupaldb;
CREATE USER 'drupaluser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL ON drupaldb.* TO 'drupaluser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
7. Extra Performance Tools: For further enhancement, consider implementing Redis for caching, Varnish for HTTP acceleration, and enabling gzip compression in Nginx. Each tool may need individual configuration and can be applied depending on your precise needs.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.