Skip to content

Knowledge base

Search every guide

Installing a web server (Nginx, PHP, MySQL)

Set up a basic LEMP stack on Ubuntu to host websites.

On a fresh Ubuntu server:

apt update
apt install -y nginx mariadb-server php-fpm php-mysql php-curl php-xml php-mbstring php-zip php-gd
mysql_secure_installation

Then:

  1. Put your site in /var/www/example.com and create an Nginx server block for it in /etc/nginx/sites-available/.
  2. Enable it with a link in sites-enabled, test with nginx -t and reload with systemctl reload nginx.
  3. Point your domain to the server: see Pointing a domain to your server.
  4. Add free HTTPS: see Free SSL with Certbot.

Prefer a control panel, or want us to run the server for you? Look at managed services, or open a ticket to the Managed Department.

Learn step by step in the free Getting started with a VPS course.