Skip to content
Launch offer: Free installation on every Extended license this month! Shop now
  1. Home
  2. Knowledge Base
  3. Installation Guides
  4. How to install a Laravel project on a VPS (Ubuntu + Nginx)

How to install a Laravel project on a VPS (Ubuntu + Nginx)

For developers deploying on DigitalOcean, AWS or Contabo.

Installation Guides Updated Nov 02, 2026 687 views

Install the stack

sudo apt update
sudo apt install nginx mysql-server php8.3-fpm php8.3-{mysql,mbstring,xml,curl,zip,gd,bcmath,intl} unzip

Upload & configure

cd /var/www && sudo unzip product.zip -d mysite
cd mysite && cp .env.example .env
php artisan key:generate
sudo chown -R www-data:www-data storage bootstrap/cache

Nginx server block

server {
    server_name example.com;
    root /var/www/mysite/public;
    index index.php;
    location / { try_files $uri $uri/ /index.php?$query_string; }
    location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.3-fpm.sock; }
}

SSL

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com
Was this article helpful?