🚀 Deploy Laravel on DigitalOcean from A–Z (Complete Guide 2026)
Introduction
If you’re a Laravel developer looking for a reliable, affordable cloud platform, DigitalOcean is one of the best options available. In this guide, you’ll learn how to deploy a Laravel application to production step by step.
Why choose DigitalOcean for Laravel?
Affordable plans starting at $5/month
Full root access to your server
Fast SSD storage and global data centers
Simple UI compared to AWS or GCP
👉 Perfect for startups, freelancers, and developers.
Prerequisites
Before we begin, make sure you have:
A DigitalOcean account
A Laravel project (GitHub or local)
Basic SSH knowledge
A domain (optional)
Step 1: Create a Droplet (VPS)
Log in to DigitalOcean
Click Create Droplet
Choose:
Ubuntu 22.04 LTS
Basic plan (1GB RAM is enough to start)
Region: Singapore or Tokyo
Click Create Droplet
Step 2: Connect to your server
ssh root@your_server_ip
Step 3: Install server stack
Install Nginx, PHP, MySQL, and Composer:
apt update && apt upgrade -y
apt install nginx mysql-server php php-fpm php-mysql php-cli php-curl php-mbstring php-xml php-zip composer -y
Step 4: Upload Laravel project
cd /var/www
git clone https://github.com/your-repo.git laravel-app
cd laravel-app
composer install --no-dev
Step 5: Configure environment
cp .env.example .env
php artisan key:generate
Step 6: Configure Nginx
nano /etc/nginx/sites-available/laravel
Add:
server {
listen 80;
server_name yourdomain.com;
root /var/www/laravel-app/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
include fastcgi_params;
}
}
Step 7: Enable SSL
apt install certbot python3-certbot-nginx -y
certbot --nginx -d yourdomain.com
Final Result
Your Laravel app is now live in production 🎉
