DEV Community

Cover image for Deploy Your First Laravel App in Under 10 Minutes with Deploynix
Deploynix
Deploynix

Posted on • Originally published at deploynix.io

Deploy Your First Laravel App in Under 10 Minutes with Deploynix

You have built something great. A Laravel application that works perfectly on your local machine, passes all your tests, and is ready for the world to see. But between your laptop and a production URL, there is a gauntlet of server configuration, SSH keys, Nginx configs, SSL certificates, database provisioning, and deployment scripts. For many Laravel developers, this is where momentum dies.

Deploynix exists to eliminate that friction entirely. In this tutorial, you will go from zero to a live, production-ready Laravel application in under ten minutes. No SSH terminal required. No copy-pasting Nginx configuration blocks from Stack Overflow. Just a clean, repeatable deployment workflow that scales with you.

Let us walk through every step.

Prerequisites

Before you begin, make sure you have the following ready:

  • A Deploynix account at deploynix.io. The free tier is enough to follow this tutorial.
  • A cloud provider account with one of the supported providers: DigitalOcean, Vultr, Hetzner, Linode, or AWS. If you prefer to use your own infrastructure, Deploynix also supports custom servers.
  • A Git repository containing your Laravel application, hosted on GitHub, GitLab, Bitbucket, or a custom Git provider.
  • Your Laravel application should have a valid composer.json and should be deployable via a standard git pull, composer install, npm run build workflow.

That is it. You do not need to know how to configure Nginx, set up PHP-FPM, or manage firewall rules. Deploynix handles all of that.

Step 1: Connect Your Cloud Provider (1 Minute)

After signing up and logging into your Deploynix dashboard, the first thing you need to do is connect a cloud provider. Navigate to your organization settings and find the cloud provider integrations section.

Click the provider you want to use. For this tutorial, we will use DigitalOcean as the example, but the process is nearly identical across all supported providers.

Deploynix will ask for an API token. Head to your DigitalOcean dashboard, generate a personal access token with read and write permissions, and paste it into Deploynix. The platform will validate the token immediately and confirm the connection.

Once connected, Deploynix can communicate directly with your cloud provider to create, manage, and destroy servers on your behalf. You never need to log into the cloud provider dashboard again for routine operations.

Step 2: Connect Your Git Provider (1 Minute)

Next, connect your Git provider. Navigate to the source control section of your organization settings and click on GitHub, GitLab, or Bitbucket.

For GitHub, Deploynix uses a GitHub App installation. You will be redirected to GitHub to authorize the application and select which repositories it can access. You can grant access to all repositories or select specific ones.

Once authorized, Deploynix can read your repositories, set up deploy keys, and configure webhooks for automatic deployments. This is the foundation for push-to-deploy functionality that you can enable later.

Step 3: Provision Your Server (3-4 Minutes)

Now the exciting part. Click the "Create Server" button in your dashboard. Deploynix will present you with a server creation form that asks for a few key details.

Server Name: Give your server a meaningful name. Something like "production-api" or "my-first-app" works well.

Cloud Provider: Select the provider you connected in Step 1. Deploynix will automatically fetch the available regions and server sizes from your provider.

Region: Choose a region close to your target audience. If your users are primarily in Europe, pick a European data center. If they are in North America, choose accordingly.

Server Size: For a starter Laravel application, a 1GB RAM / 1 vCPU instance is sufficient. You can always resize later. For applications with heavier workloads, consider starting with 2GB RAM.

Server Type: Select "App Server" for a standard Laravel deployment. This provisions a complete stack including Nginx, PHP 8.4, your chosen database, Valkey (a Redis-compatible cache), and Supervisor for queue workers.

Database: Choose from MySQL, MariaDB, or PostgreSQL. MySQL is the most common choice for Laravel applications, but PostgreSQL is an excellent option if your application uses advanced database features.

PHP Version: Deploynix supports the latest PHP versions. Select PHP 8.4 for the best performance and access to the newest language features.

Click "Create Server" and watch as Deploynix provisions your infrastructure. Behind the scenes, the platform is communicating with your cloud provider's API to spin up the virtual machine. Once the VM is ready, Deploynix connects via SSH and begins configuring the server.

During provisioning, Deploynix installs and configures:

  • Nginx as the web server with optimized settings for Laravel
  • PHP 8.4 with FPM and all commonly needed extensions (mbstring, xml, curl, zip, bcmath, gd, and more)
  • Your chosen database with a secure default configuration
  • Valkey for caching and session storage
  • Supervisor for managing queue workers and daemons
  • Firewall rules allowing only SSH, HTTP, and HTTPS traffic
  • Automatic security updates for the operating system
  • A deploynix user with proper permissions for deployments

This process typically takes three to four minutes. Deploynix shows you real-time progress so you know exactly what is happening.

Step 4: Create Your Site (1 Minute)

Once your server is provisioned and shows a "Ready" status, it is time to create a site. Click into your server and select "New Site."

You will be asked for:

Domain: Enter your domain name, such as myapp.com. If you do not have a domain yet, Deploynix provides free vanity domains under *.deploynix.cloud. You can enter something like my-first-app.deploynix.cloud and get a working URL instantly. Note that custom domains require a Starter plan or above, while vanity domains are available on all plans, including the free tier.

Project Type: Select "Laravel" from the available options.

Web Directory: The default /public is correct for Laravel applications. Leave this as is.

Repository: Select the Git repository containing your Laravel application. Deploynix will list the repositories accessible through your connected Git provider.

Branch: Choose the branch you want to deploy from. Typically this is main or master.

Click "Create Site" and Deploynix will configure the Nginx virtual host, set up the deployment directory structure, and prepare everything for your first deployment.

Step 5: Configure Your Environment (1 Minute)

Before deploying, you need to configure your application's environment variables. Deploynix provides a built-in environment editor accessible from your site's dashboard.

Click "Environment" to open the editor. Deploynix pre-populates a sensible .env file for Laravel, but you will want to update a few key values:

  • APP_NAME — Set this to your application's name
  • APP_URL — Set this to your domain or vanity domain URL
  • DB_DATABASE, DB_USERNAME, DB_PASSWORD — Deploynix automatically creates a database and user during site setup. These credentials are pre-filled for you
  • CACHE_STORE — Set to redis to use Valkey
  • SESSION_DRIVER — Set to redis for production-grade session handling
  • QUEUE_CONNECTION — Set to redis if your application uses queued jobs

If your application uses external services like mail providers, payment gateways, or third-party APIs, add those credentials here as well.

Save the environment file when you are done. Deploynix encrypts and securely stores your environment variables.

Step 6: Deploy Your Application (1-2 Minutes)

Everything is configured. It is time to deploy. Click the "Deploy" button on your site's dashboard.

Deploynix executes a deployment pipeline that includes:

  1. Cloning your repository into a new release directory
  2. Installing Composer dependencies with composer install --no-dev --optimize-autoloader
  3. Installing Node dependencies and building assets with npm ci && npm run build (if a package.json exists)
  4. Running database migrations with php artisan migrate --force
  5. Optimizing the application with config, route, and view caching
  6. Symlinking the new release as the active deployment
  7. Reloading PHP-FPM to pick up the new code

This is a zero-downtime deployment. The old release continues serving traffic until the new release is fully ready. Only then does the symlink switch happen, ensuring your users never see a broken page during deployment.

You can watch the deployment log in real time. Each step shows its output so you can catch any issues immediately.

Step 7: Verify Your Deployment (30 Seconds)

Once the deployment completes successfully, visit your domain or vanity URL in a browser. You should see your Laravel application running live.

If you used a vanity domain like my-first-app.deploynix.cloud, Deploynix automatically provisions an SSL certificate, so your site is served over HTTPS from the start.

If you are using your own domain, you will need to point your DNS records to your server's IP address. Create an A record pointing your domain to the IP shown in your Deploynix server dashboard. Once DNS propagates, Deploynix can provision a free Let's Encrypt SSL certificate for your domain with a single click.

What Happens Next

Congratulations. Your Laravel application is live on a properly configured production server. But this is just the beginning. Here are a few things you might want to set up next:

Automatic Deployments: Enable push-to-deploy so that every push to your main branch triggers an automatic deployment. No more manually clicking the deploy button.

Deployment Hooks: Add custom commands that run before or after specific deployment steps. Need to run a seed command? Clear a specific cache? Deployment hooks make this trivial.

Queue Workers: If your application uses queued jobs, navigate to the Daemons section and configure a queue worker. Deploynix manages it through Supervisor, ensuring it restarts automatically if it crashes.

Scheduled Tasks: Add your Laravel scheduled commands through the Cron Jobs interface. Deploynix handles the cron configuration on the server.

SSL Certificates: If you are using a custom domain, provision a free Let's Encrypt certificate through the SSL section of your site dashboard.

Health Monitoring: Enable health checks and alerts so Deploynix notifies you if your application goes down or if server resources are running low.

Backups: Configure automated database backups to AWS S3, DigitalOcean Spaces, Wasabi, or any S3-compatible storage provider. Never lose data again.

Troubleshooting Common Issues

Deployment fails at Composer install: Make sure your composer.lock file is committed to your repository. Deploynix uses composer install, not composer update, so the lock file is required.

Application shows a 500 error: Check your environment variables. The most common cause is a missing APP_KEY. If you did not include one in your .env, run the generate key option from your site dashboard.

Assets are not loading: If your application uses Vite or Laravel Mix, ensure that npm run build is part of your deployment process. Deploynix handles this automatically if a package.json is detected, but verify that your build script is correctly defined.

Database connection refused: Confirm that your database credentials in the .env file match the ones Deploynix generated during site setup. The credentials are visible in your site's database settings panel.

Conclusion

What used to take hours of server configuration now takes under ten minutes. Deploynix handles the infrastructure complexity so you can focus on building great Laravel applications.

The platform grows with you. Start with a single server on the free tier, and scale to multiple servers with load balancing, dedicated database servers, and worker servers as your application demands it. Every server you provision through Deploynix is configured with the same production-grade defaults, ensuring consistency across your infrastructure.

Ready to deploy your first app? Sign up at deploynix.io and have your Laravel application live in minutes, not hours.

Top comments (0)