KBDéveloppement

Déployer une application Laravel sur VPS

9 vues · Mis à jour le 22/05/2026

Laravel sur VPS

Prérequis

apt install nginx php8.2-fpm php8.2-mysql php8.2-xml php8.2-mbstring php8.2-curl php8.2-zip composer git

Déploiement

cd /var/www\ngit clone https://github.com/user/app.git\ncd app\ncomposer install --no-dev --optimize-autoloader\ncp .env.example .env\nphp artisan key:generate\nphp artisan migrate\nphp artisan config:cache\nphp artisan route:cache

Nginx

server {\n    listen 80;\n    server_name votredomaine.ca;\n    root /var/www/app/public;\n    index index.php;\n    location / { try_files $uri $uri/ /index.php?$query_string; }\n    location ~ \.php$ {\n        fastcgi_pass unix:/run/php/php8.2-fpm.sock;\n        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}

Permissions

chown -R www-data:www-data /var/www/app\nchmod -R 755 storage bootstrap/cache
Cet article vous a-t-il été utile?
Besoin d'aide?

Vous n'avez pas trouvé votre réponse?

Ouvrir un ticket
Écosystème NHC : 🌐 NHC Hosting 🚀 NHC Portal 🖥️ NHC Panel 🔑 NHC Manager 📡 NHC Uptime 🛡️ NHC Security