Skip to content

How to Deploy Easy Restaurant on an Ubuntu VPS with Nginx

  • by

This guide explains how to deploy Easy Restaurant on an Ubuntu VPS using Nginx, PHP 8.2, MySQL, and Supervisor.

The procedure can be used with providers such as DigitalOcean, Linode, Vultr, Hetzner, or AWS EC2.

Requirements

Before installing Easy Restaurant, you need:

  • An Ubuntu 22.04 or 24.04 VPS
  • Root or sudo access
  • A domain name pointed to the server
  • SSH access

Step 1 — Update Ubuntu

Run:

sudo apt update && sudo apt upgrade -y

Install the basic server packages:

sudo apt install -y nginx mysql-server git unzip

Step 2 — Install PHP for Easy Restaurant

Add the PHP repository:

sudo add-apt-repository ppa:ondrej/php -y

Update the package list:

sudo apt update

Install PHP 8.2 and the extensions required by Easy Restaurant:

sudo apt install -y php8.2 php8.2-fpm php8.2-mysql php8.2-mbstring \
php8.2-xml php8.2-bcmath php8.2-curl php8.2-zip php8.2-gd \
php8.2-intl php8.2-redis

Step 3 — Install Composer

Install Composer:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Verify:

composer --version

Step 4 — Create the Easy Restaurant Database

Secure MySQL:

sudo mysql_secure_installation

Open MySQL:

sudo mysql

Create the Easy Restaurant database:

CREATE DATABASE restaurant_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Create the database user:

CREATE USER 'restaurant_user'@'localhost' IDENTIFIED BY 'StrongPass!123';

Grant privileges:

GRANT ALL PRIVILEGES ON restaurant_db.* TO 'restaurant_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Use a strong production password instead of the example password.

Step 5 — Download Easy Restaurant

Navigate to /var/www:

cd /var/www

Clone the Easy Restaurant project:

sudo git clone https://github.com/your-org/easy-restaurant.git

Enter the application directory:

cd easy-restaurant

Install the Easy Restaurant production dependencies:

sudo composer install --no-dev --optimize-autoloader

Create the environment file:

sudo cp .env.example .env

Step 6 — Configure Easy Restaurant

Edit the .env file:

APP_NAME="Easy Restaurant"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=restaurant_db
DB_USERNAME=restaurant_user
DB_PASSWORD=StrongPass!123

Configure any other Easy Restaurant services required by your installation.

Step 7 — Initialize Easy Restaurant

Generate the application key:

sudo php artisan key:generate

Run the migrations:

sudo php artisan migrate --force

Seed the administrator and demo tenant data:

sudo php artisan db:seed --class=SuperAdminSeeder
sudo php artisan db:seed --class=DemoTenantSeeder

Create the storage link:

sudo php artisan storage:link

Optimize Easy Restaurant:

sudo php artisan optimize

Step 8 — Set Easy Restaurant Permissions

Set the application ownership:

sudo chown -R www-data:www-data /var/www/easy-restaurant

Set the standard application permissions:

sudo chmod -R 755 /var/www/easy-restaurant

Set writable permissions for Laravel directories:

sudo chmod -R 775 /var/www/easy-restaurant/storage
sudo chmod -R 775 /var/www/easy-restaurant/bootstrap/cache

Step 9 — Configure Nginx for Easy Restaurant

Create the Nginx configuration:

sudo nano /etc/nginx/sites-available/easy-restaurant

Add:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    root /var/www/easy-restaurant/public;
    index index.php;

    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_hide_header X-Powered-By;
    }

    location ~ /(\.env|\.git|composer\.(json|lock)) {
        deny all;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

Enable the Easy Restaurant site:

sudo ln -s /etc/nginx/sites-available/easy-restaurant /etc/nginx/sites-enabled/

Test Nginx:

sudo nginx -t

Reload Nginx:

sudo systemctl reload nginx

Step 10 — Enable HTTPS for Easy Restaurant

Install Certbot:

sudo apt install -y certbot python3-certbot-nginx

Create an SSL certificate:

sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Follow the prompts to enable HTTPS for Easy Restaurant.

Step 11 — Configure the Easy Restaurant Queue Worker

Easy Restaurant uses background queues for tasks such as exports, emails, and AI-related features.

Install Supervisor:

sudo apt install -y supervisor

Create a Supervisor configuration:

sudo nano /etc/supervisor/conf.d/easy-restaurant-worker.conf

Add:

[program:easy-restaurant-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/easy-restaurant/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/easy-restaurant/storage/logs/worker.log

Reload Supervisor:

sudo supervisorctl reread
sudo supervisorctl update

Start the Easy Restaurant workers:

sudo supervisorctl start easy-restaurant-worker:*

Step 12 — Verify Easy Restaurant

Open:

https://yourdomain.com

The Easy Restaurant application should now be available.

Open:

https://yourdomain.com/login

and sign in using the administrator credentials provided with your Easy Restaurant installation.