What you need before starting
- A Linux server (Ubuntu is the best documented choice) with SSH access.
- PHP with the extensions your Laravel version requires, Composer and a web server (Nginx or Apache).
- A database (MySQL or PostgreSQL) and a domain.
- Your code in a repository (GitHub or GitLab).
The steps, in short
- Prepare the server: create a non-root user, enable the firewall and update packages.
- Install PHP, Composer and Nginx and create the database with a dedicated user for your app.
- Clone the project and run
composer install --no-dev --optimize-autoloader. - Create the
.envfile with production values:APP_ENV=production,APP_DEBUG=false, the database and theAPP_KEY(php artisan key:generate). - Point Nginx to the
public/folder, never to the project root. That way nobody can read your.env. - Run the migrations with
php artisan migrate --forceand cache the configuration withphp artisan config:cache. - Give write permissions on
storage/andbootstrap/cache/to the web server user. - Enable HTTPS with a free Let’s Encrypt certificate.
Common mistakes
- Leaving
APP_DEBUG=truein production: it exposes passwords and internal paths. - Forgetting
php artisan storage:link, so uploaded images do not show. - Not setting up the task scheduler (cron) or the queue worker, so emails and jobs never go out.
- Committing the
vendor/folder or the.envfile to the repository.
How we help
In the free session we review your project and tell you which server fits. Then we put it online with a domain, HTTPS, automatic deploys and backups, or we guide you so you do it yourself.