Setting Up Multiple Laravel Projects on Nginx in Linux
DevOps

Setting Up Multiple Laravel Projects on Nginx in Linux

Aashish Timalsina
Aashish Timalsina

January 11, 2025

3 min read1,320 views

A practical guide to host multiple Laravel apps with Nginx, including cleanup, site templates, and service setup.

# Setting Up Multiple Laravel Projects on Nginx in Linux This guide explains how to manage multiple Laravel projects under one Nginx setup. ## Clean Existing Config Stop nginx, back up existing configuration, and reset sites-available and sites-enabled to avoid conflict from old settings. ## Prepare Runtime Install php-fpm and required PHP extensions, configure the socket path, and create consistent project directories. ## Per-Project Server Blocks Create one server block per Laravel project with the correct public root and PHP-FPM handler. ## Enable and Validate Symlink each config into sites-enabled, update hosts entries for local mapping, and run nginx -t before restart. ## Ongoing Workflow For each new project: add config, enable site, update hosts, set permissions, and reload nginx.
Aashish Timalsina

Aashish Timalsina

Full-stack developer focused on Laravel, Django, Docker, and practical server deployment workflows.

View Profile2,340 followers

Related Articles