Streamlined Production Deployment on Ubuntu 24.04

Streamlined Production Deployment on Ubuntu 24.04

posted Originally published at insafnilam.hashnode.dev 2 min read

Deploying a full-stack application for production doesn’t have to be complicated — especially if you follow a structured setup. For azan.lk, a Laravel + React project backed by MySQL, I built a fully optimized, secure deploymenton Ubuntu 24.04, running on a DigitalOcean Droplet.

This post is a quick overview of what the major components you’ll handle.


⚙️ What This Covers

This deployment walkthrough is designed for modern full-stack apps and covers the full stack you’d expect in real production:

  • Laravel backend (PHP 8.4, FPM, Composer)
  • React frontend (bundled via Vite)
  • MySQL database (hardened & configured)
  • Nginx production server
  • Node.js + NPM via NVM
  • Git + SSH for secure deployments
  • Environment setup, permissions, and optimizations

If you’re deploying a portfolio, client project, SaaS, or API backend, this setup gives you a fast, stable, security-conscious structure.


Before Deployment: Essential Prerequisites

Make sure your droplet is secure and ready for production.
I recommend completing these two guides first:

1. Server Hardening (Must Do Before Anything)

Fortify Your DigitalOcean Droplet: A Step-by-Step Security Guide for Ubuntu 24.04
A complete walkthrough covering non-root users, SSH keys, firewall, Fail2Ban, and more.

2. Enable HTTPS (Required for Live Apps)

Fortify Your Droplet: Unlock Free HTTPS with Let’s Encrypt SSL
Includes DNS setup, Nginx configs, SSL installation, and auto-renewal.

Once both are done, your droplet is safe to host real traffic — and ready for deployment.


✨ What You’ll Accomplish

  • Install PHP 8.4 with all required extensions for production
  • Set up Composer safely using the official installer
  • Configure MySQL with proper users, permissions, and best practices
  • Install Node.js via NVM for frontend builds
  • Set up Git SSH keys for secure repository access
  • Configure application permissions for Laravel
  • Build and optimize your frontend assets for production
  • Set up Nginx with proper routing, headers, and FPM integration
  • Run database migrations and seeders
  • Troubleshoot common deployment issues like PHP errors, permissions, or SSH problems

Every step — with commands, configs, and explanations — is included in the full guide on Hashnode.


Read the Full, Detailed Guide

The complete command-by-command walkthrough — including explanations, and best practices — is available on my blog.

Read the full article here:
Streamlined App Deployment: Launch Your First Web App on Ubuntu 24.04 with DigitalOcean

The post includes every command, config file, and optimization used in the real-world deployment of azan.lk.


Why This Guide Matters

Most deployment tutorials are outdated, incomplete, or skip critical production details.
This guide focuses on:

  • Security (SSL, firewall, SSH hardening)
  • Performance (PHP-FPM tuning, Vite builds)
  • Stability (MySQL, permissions, proper Nginx configs)
  • Developer workflow (Git SSH, easy updates, reliable builds)

Ideal for developers deploying real-world projects into production.


Final Thoughts

A reliable deployment is more than just “upload code and run”:
it’s a combination of security, performance, and correct configuration.

1 Comment

1 vote
1

More Posts

Fortify Your DigitalOcean Droplet: A Step-by-Step Security Guide for Ubuntu 24.04

InsafNilam - Dec 2, 2025

What Is an Availability Zone Explained Simply

Ijay - Feb 12

Effortless Web App Deployments with GitHub Actions

InsafNilam - Dec 13, 2025

Why most people quit AWS

Ijay - Feb 3

Secure Your DigitalOcean Droplet with Free HTTPS (Let’s Encrypt + Certbot)

InsafNilam - Dec 3, 2025
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

4 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!