Streamlined Production Deployment on Ubuntu 24.04

Streamlined Production Deployment on Ubuntu 24.04

2 8 15
calendar_todayschedule2 min read
— Originally published at insafnilam.hashnode.dev

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.

2 Comments

1 vote
1
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Delivering Database Changes

Steve Fentonverified - Jul 22

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

InsafNilam - Dec 2, 2025

Effortless Web App Deployments with GitHub Actions

InsafNilam - Dec 13, 2025

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

InsafNilam - Dec 3, 2025

Here is the Kimi Desktop on Ubuntu 26.04 noone asked for..... Because I am creating 1 desktop a day

johnohhh1 - Apr 13
chevron_left
983 Points25 Badges
Colombo, Sri Lankainsaf.me
4Posts
4Comments
1Connections
I’m a tech-savvy full-stack developer who loves exploring every corner of technology and learning so... Show more

Related Jobs

View all jobs →

Commenters (This Week)

7 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!