HostSlim

How do I install a web server (Nginx, PHP and MariaDB) on Ubuntu?

This sets up a basic LEMP stack on Ubuntu or Debian. sudo apt update sudo apt install nginx mariadb-server php-fpm php-mysql sudo systemctl enable --now…

  • VPS

This sets up a basic LEMP stack on Ubuntu or Debian.

sudo apt update
sudo apt install nginx mariadb-server php-fpm php-mysql
sudo systemctl enable --now nginx mariadb
sudo mysql_secure_installation

Put your website in /var/www/yourdomain and create a server block in /etc/nginx/sites-available/, then enable it with a symlink in sites-enabled and run sudo nginx -t && sudo systemctl reload nginx.

Next step: secure your site with a free certificate – see How do I get a free SSL certificate with Certbot?

Prefer a graphical control panel? You can also install a hosting panel on your VPS, or choose our managed services.

More from the knowledge base

Need something that is not on the list?

Custom builds, private VLANs, BGP sessions, multi-rack deployments. Tell us what you are running and an engineer replies, usually within the hour.