CLOUD
Guides

Deploying Laravel on a Saudi Server: Complete Guide

CLOUD|April 6, 2026|4 min read|427 views
Deploying Laravel on a Saudi Server: Complete Guide

From server setup to Nginx + PHP-FPM + MySQL + SSL + Queue Worker + Scheduler. Laravel deployment step by step.

Why Deploy Laravel on a Saudi Server?

Laravel is the most widely used PHP framework in the Arab world. The majority of custom systems in Saudi Arabia — from ERP systems to client portals — are built with Laravel. Yet many developers deploy them on servers in the United States or Europe without considering the implications.

Deploying your application on a Saudi server gives you: 8ms response time instead of 150ms, compliance with data localization requirements, and the ability to integrate with government systems like National Access (Nafath).

Prerequisites

Server Specifications

Application SizeCPURAMStorageAnnual Cost
Small (up to 1,000 users)2 vCPU4 GB40 GBcompetitive pricing — pricing and plans
Medium (1,000-10,000)4 vCPU8 GB100 GB1affordable pricing — pricing and plans
Large (10,000+)8 vCPU16 GB200 GB19,500 SAR

Required Software

  • Operating system: Ubuntu 24.04 LTS (best supported and documented)
  • PHP 8.3+ with required extensions: mbstring, xml, curl, zip, bcmath, gd, intl
  • Composer 2.x for package management
  • Nginx (faster than Apache for Laravel applications)
  • MySQL 8.0 or PostgreSQL 16 (PostgreSQL is faster for complex queries)
  • Redis for caching, session management, and queues
  • Supervisor for running Queue Workers
  • Node.js 20 LTS for frontend building (if using Vite)

Deployment Steps: From Zero to Production

Phase 1: Server Setup

After receiving login credentials from CLOUD (cloud.net.sa), the first steps:

  1. Update the system completely
  2. Create a non-root deployment user (never run the application as root)
  3. Configure the firewall: allow only ports 22 (SSH), 80 (HTTP), 443 (HTTPS)
  4. Set up SSH key authentication and disable root password login
  5. Install fail2ban for brute-force protection

Phase 2: Software Installation

Install PHP with all extensions from the Ondrej PPA repository. Install Nginx from the official repository. Install MySQL or PostgreSQL based on your preference. Install Redis and enable it as an auto-starting service.

Phase 3: Nginx Configuration

Configuring Nginx for Laravel requires attention to several points:

  • The root directive points to the public directory of your project
  • Route all requests to index.php (Laravel routing)
  • Block direct access to .env and .git files
  • Enable gzip compression for responses
  • Set security headers: X-Frame-Options, X-Content-Type-Options, Strict-Transport-Security

Phase 4: Application Deployment

  1. Clone the project from Git into the deployment directory
  2. Run composer install --optimize-autoloader --no-dev
  3. Copy the .env file and update database and cache settings
  4. Generate the application key with php artisan key:generate
  5. Run migrations: php artisan migrate --force
  6. Build the frontend: npm install && npm run build
  7. Set permissions: storage and bootstrap/cache directories must be writable by the www-data user

Phase 5: Production Optimizations

These commands are essential and noticeably improve performance:

  • php artisan config:cache — compiles configuration files into a single file
  • php artisan route:cache — compiles the routing table
  • php artisan view:cache — compiles Blade templates
  • php artisan event:cache — compiles application events
  • php artisan optimize — runs all optimizations at once

SSL Certificate Setup

Let's Encrypt is free and trusted. Install Certbot and activate the certificate with automatic renewal every 60 days. There is no reason to run a site without HTTPS in 2026.

Queue Setup

Laravel relies on queues for executing heavy tasks asynchronously: sending emails, processing images, generating reports. Configure Supervisor to run queue:work and ensure automatic restart on failure.

Task Scheduling

Add the php artisan schedule:run command to crontab to run every minute. This allows Laravel to execute scheduled tasks (session cleanup, notification sending, periodic reports).

Backup Strategy

  • Database: daily backup plus before every new deployment
  • Storage files (storage/app): daily backup
  • .env file: securely stored copy (contains sensitive keys)
  • CLOUD backup service: activate for additional security

Monitoring

  • Laravel Telescope for development: logs all requests, queries, and exceptions
  • Laravel Pulse for production: built-in monitoring dashboard showing real-time application performance
  • Server monitoring: CPU, memory, and disk usage — alert at 80%

Automated Deployment (CI/CD)

For advanced teams, connect your Git repository to an automated deployment tool:

  • GitHub Actions: run tests and auto-deploy on merge to the main branch
  • Laravel Forge: a paid service that manages server and deployment entirely
  • Custom deploy script: the simplest option — a bash script that pulls updates and rebuilds the application

Summary

Deploying a Laravel application on a Saudi server is a straightforward process when you follow the steps in order. The server is ready automatically and quickly from CLOUD, setup takes one hour, and the result: an application running at 8ms response time, data within the Kingdom, and a production-ready architecture built to scale.

--- ### Get Started Ready to build your project? Configure your cloud server with the specs your app needs, or view plans and pricing.
Share