<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged digitalocean</title>
<link>https://coderlegion.com/tag/digitalocean</link>
<description>Powered by Question2Answer</description>
<item>
<title>Effortless Web App Deployments with GitHub Actions</title>
<link>https://coderlegion.com/8448/effortless-web-app-deployments-with-github-actions</link>
<description>&lt;h4 id=&quot;automating-production-deployments-on-digitalocean&quot;&gt;Automating Production Deployments on DigitalOcean&lt;/h4&gt;
&lt;p&gt;Deploying web applications manually gets painful fast — especially once your project grows.&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;azan.lk&lt;/strong&gt;, a Laravel + React application running on a hardened DigitalOcean droplet, I moved from manual SSH-based deployments to a &lt;strong&gt;fully automated CI/CD pipeline using GitHub Actions&lt;/strong&gt;.&lt;br&gt;
Every push to &lt;code&gt;main&lt;/code&gt; now builds, deploys, and optimizes the app automatically — safely and consistently.&lt;/p&gt;
&lt;p&gt;This article gives you a &lt;strong&gt;practical, production-ready overview&lt;/strong&gt; of how to automate deployments without overengineering.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-what-this-covers&quot;&gt;⚙️ What This Covers&lt;/h3&gt;
&lt;p&gt;This guide focuses on &lt;strong&gt;real-world CI/CD for VPS-based deployments&lt;/strong&gt;, not platform-locked solutions.&lt;/p&gt;
&lt;p&gt;You’ll learn how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automate deployments using &lt;strong&gt;GitHub Actions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Build Laravel &amp;amp; React &lt;strong&gt;outside the server&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Deploy via &lt;strong&gt;SSH securely&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Run database migrations and optimizations remotely&lt;/li&gt;
&lt;li&gt;Keep your DigitalOcean droplet &lt;strong&gt;lean and stable&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Eliminate repetitive SSH workflows&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Perfect for portfolios, SaaS apps, client projects, or APIs running on a VPS.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;prerequisites-important-&quot;&gt;Prerequisites (Important)&lt;/h3&gt;
&lt;p&gt;Before adding automation, your server must already be production-ready.&lt;/p&gt;
&lt;p&gt;Make sure you’ve completed these first:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server Hardening&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Non-root user&lt;/li&gt;
&lt;li&gt;SSH keys&lt;/li&gt;
&lt;li&gt;Firewall &amp;amp; Fail2Ban&lt;br&gt;
&lt;em&gt;Fortify Your DigitalOcean Droplet: A Step-by-Step Security Guide for Ubuntu 24.04&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTPS &amp;amp; SSL&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;Let’s Encrypt&lt;/li&gt;
&lt;li&gt;Auto-renewal&lt;br&gt;
&lt;em&gt;Unlock Free HTTPS with Let’s Encrypt SSL&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Manual Deployment Setup&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Laravel + PHP-FPM&lt;/li&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;Node &amp;amp; Vite&lt;br&gt;
&lt;em&gt;Streamlined App Deployment on Ubuntu 24.04&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once those are done, CI/CD becomes the final layer — not a replacement.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-problem-with-traditional-deployments&quot;&gt;The Problem with Traditional Deployments&lt;/h3&gt;
&lt;p&gt;A typical manual deployment looks like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SSH into the server&lt;/li&gt;
&lt;li&gt;Pull latest code&lt;/li&gt;
&lt;li&gt;Run Composer&lt;/li&gt;
&lt;li&gt;Run NPM builds&lt;/li&gt;
&lt;li&gt;Fix permissions&lt;/li&gt;
&lt;li&gt;Run migrations&lt;/li&gt;
&lt;li&gt;Hope nothing breaks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On small VPS instances, Composer and NPM can &lt;strong&gt;consume memory, slow the server, or even crash builds&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;And doing this repeatedly?&lt;br&gt;
That’s technical debt waiting to happen.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-you-ll-accomplish-with-ci-cd&quot;&gt;What You’ll Accomplish with CI/CD&lt;/h3&gt;
&lt;p&gt;By the end of this setup, you’ll have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automatic deployments on every push to &lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Builds handled by &lt;strong&gt;GitHub&lt;/strong&gt;, not your VPS&lt;/li&gt;
&lt;li&gt;Secure SSH-based file sync&lt;/li&gt;
&lt;li&gt;Zero manual server logins for deploys&lt;/li&gt;
&lt;li&gt;Reliable, repeatable production releases&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Push code → GitHub Actions runs → App goes live&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;why-this-approach-works&quot;&gt;Why This Approach Works&lt;/h3&gt;
&lt;p&gt;This setup is optimized for developers who:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;VPS hosting&lt;/strong&gt; instead of managed platforms&lt;/li&gt;
&lt;li&gt;Want &lt;strong&gt;full control&lt;/strong&gt; over infrastructure&lt;/li&gt;
&lt;li&gt;Care about &lt;strong&gt;performance and stability&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Prefer simple, understandable pipelines&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No Kubernetes.&lt;br&gt;
No overcomplicated workflows.&lt;br&gt;
Just clean automation that works.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;read-the-full-step-by-step-guide&quot;&gt;Read the Full Step-by-Step Guide&lt;/h3&gt;
&lt;p&gt;The full article includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Complete &lt;code&gt;deploy.yml&lt;/code&gt; workflow&lt;/li&gt;
&lt;li&gt;GitHub Secrets setup&lt;/li&gt;
&lt;li&gt;SSH key best practices&lt;/li&gt;
&lt;li&gt;Common CI/CD pitfalls (and how to avoid them)&lt;/li&gt;
&lt;li&gt;Production-safe Artisan commands&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://insafnilam.hashnode.dev/effortless-web-app-deployments-mastering-github-actions-with-digitalocean&quot;&gt;Effortless Web App Deployments: Mastering GitHub Actions with DigitalOcean&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-final-thoughts&quot;&gt;✨ Final Thoughts&lt;/h3&gt;
&lt;p&gt;CI/CD isn’t about complexity — it’s about &lt;strong&gt;removing friction&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Once this pipeline is in place:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deployments become boring (that’s good)&lt;/li&gt;
&lt;li&gt;Servers stay fast&lt;/li&gt;
&lt;li&gt;Mistakes drop dramatically&lt;/li&gt;
&lt;li&gt;Your workflow scales with your project&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pair this guide with &lt;strong&gt;Streamlined App Deployment on Ubuntu 24.04&lt;/strong&gt;, and your readers get a complete journey:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Manual setup → hardened server → automated production deployments&lt;/strong&gt;&lt;/p&gt;
</description>
<category>Full-stack Dev</category>
<guid isPermaLink="true">https://coderlegion.com/8448/effortless-web-app-deployments-with-github-actions</guid>
<pubDate>Sat, 13 Dec 2025 16:33:23 +0000</pubDate>
</item>
<item>
<title>Streamlined Production Deployment on Ubuntu 24.04</title>
<link>https://coderlegion.com/8135/streamlined-production-deployment-on-ubuntu-24-04</link>
<description>&lt;p&gt;Deploying a full-stack application for production doesn’t have to be complicated — especially if you follow a structured setup. For &lt;strong&gt;azan.lk&lt;/strong&gt;, a Laravel + React project backed by MySQL, I built a fully optimized, secure deploymenton &lt;strong&gt;Ubuntu 24.04&lt;/strong&gt;, running on a DigitalOcean Droplet.&lt;/p&gt;
&lt;p&gt;This post is a quick overview of what the major components you’ll handle.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-what-this-covers-1&quot;&gt;⚙️ What This Covers&lt;/h3&gt;
&lt;p&gt;This deployment walkthrough is designed for modern full-stack apps and covers the full stack you’d expect in real production:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Laravel backend&lt;/strong&gt; (PHP 8.4, FPM, Composer)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;React frontend&lt;/strong&gt; (bundled via Vite)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MySQL database&lt;/strong&gt; (hardened &amp;amp; configured)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nginx production server&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Node.js + NPM via NVM&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Git + SSH for secure deployments&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment setup, permissions, and optimizations&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you’re deploying a portfolio, client project, SaaS, or API backend, this setup gives you a fast, stable, security-conscious structure.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;before-deployment-essential-prerequisites&quot;&gt;Before Deployment: Essential Prerequisites&lt;/h3&gt;
&lt;p&gt;Make sure your droplet is secure and ready for production.&lt;br&gt;
I recommend completing these two guides first:&lt;/p&gt;
&lt;h4 id=&quot;1-server-hardening-must-do-before-anything-&quot;&gt;1. Server Hardening (Must Do Before Anything)&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/8084/fortify-your-digitalocean-droplet-a-step-by-step-security-guide-for-ubuntu-24-04&quot;&gt;Fortify Your DigitalOcean Droplet: A Step-by-Step Security Guide for Ubuntu 24.04&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
A complete walkthrough covering non-root users, SSH keys, firewall, Fail2Ban, and more.&lt;/p&gt;
&lt;h4 id=&quot;2-enable-https-required-for-live-apps-&quot;&gt;2. Enable HTTPS (Required for Live Apps)&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/8116/secure-your-digitalocean-droplet-with-free-https-lets-encrypt-certbot&quot;&gt;Fortify Your Droplet: Unlock Free HTTPS with Let’s Encrypt SSL&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Includes DNS setup, Nginx configs, SSL installation, and auto-renewal.&lt;/p&gt;
&lt;p&gt;Once both are done, your droplet is safe to host real traffic — and ready for deployment.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-what-you-ll-accomplish&quot;&gt;✨ What You’ll Accomplish&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Install PHP 8.4 with all required extensions for production&lt;/li&gt;
&lt;li&gt;Set up Composer safely using the official installer&lt;/li&gt;
&lt;li&gt;Configure MySQL with proper users, permissions, and best practices&lt;/li&gt;
&lt;li&gt;Install Node.js via NVM for frontend builds&lt;/li&gt;
&lt;li&gt;Set up Git SSH keys for secure repository access&lt;/li&gt;
&lt;li&gt;Configure application permissions for Laravel&lt;/li&gt;
&lt;li&gt;Build and optimize your frontend assets for production&lt;/li&gt;
&lt;li&gt;Set up Nginx with proper routing, headers, and FPM integration&lt;/li&gt;
&lt;li&gt;Run database migrations and seeders&lt;/li&gt;
&lt;li&gt;Troubleshoot common deployment issues like PHP errors, permissions, or SSH problems&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every step — with commands, configs, and explanations — is included in the full guide on Hashnode.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;read-the-full-detailed-guide&quot;&gt;Read the Full, Detailed Guide&lt;/h3&gt;
&lt;p&gt;The complete command-by-command walkthrough — including explanations, and best practices — is available on my blog.&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;Read the full article here:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://insafnilam.hashnode.dev/streamlined-app-deployment-launch-your-laravel-react-project-on-ubuntu-2404-with-digitalocean&quot;&gt;Streamlined App Deployment: Launch Your First Web App on Ubuntu 24.04 with DigitalOcean&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The post includes every command, config file, and optimization used in the real-world deployment of &lt;strong&gt;azan.lk&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;why-this-guide-matters&quot;&gt;Why This Guide Matters&lt;/h3&gt;
&lt;p&gt;Most deployment tutorials are outdated, incomplete, or skip critical production details.&lt;br&gt;
This guide focuses on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt; (SSL, firewall, SSH hardening)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt; (PHP-FPM tuning, Vite builds)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stability&lt;/strong&gt; (MySQL, permissions, proper Nginx configs)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Developer workflow&lt;/strong&gt; (Git SSH, easy updates, reliable builds)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ideal for developers deploying real-world projects into production.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;final-thoughts&quot;&gt;Final Thoughts&lt;/h3&gt;
&lt;p&gt;A reliable deployment is more than just “upload code and run”:&lt;br&gt;
it’s a combination of &lt;strong&gt;security&lt;/strong&gt;, &lt;strong&gt;performance&lt;/strong&gt;, and &lt;strong&gt;correct configuration&lt;/strong&gt;.&lt;/p&gt;
</description>
<category>Full-stack Dev</category>
<guid isPermaLink="true">https://coderlegion.com/8135/streamlined-production-deployment-on-ubuntu-24-04</guid>
<pubDate>Wed, 03 Dec 2025 14:21:31 +0000</pubDate>
</item>
<item>
<title>Secure Your DigitalOcean Droplet with Free HTTPS (Let’s Encrypt + Certbot)</title>
<link>https://coderlegion.com/8116/secure-your-digitalocean-droplet-with-free-https-lets-encrypt-certbot</link>
<description>&lt;p&gt;Once your droplet is hardened with a non-root user, SSH hardening, and a firewall, the next upgrade you &lt;em&gt;must&lt;/em&gt; add is &lt;strong&gt;HTTPS&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Without HTTPS, your login pages, API requests, and user data travel in plain text — easy for attackers to sniff or intercept. With HTTPS enabled, you get encrypted traffic, improved trust, and that familiar browser padlock that tells users their connection is safe.&lt;/p&gt;
&lt;p&gt;This post is a quick overview of what the HTTPS setup includes.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;start-here-droplet-hardening-guide-before-https-&quot;&gt;Start Here: Droplet Hardening Guide (Before HTTPS)&lt;/h3&gt;
&lt;p&gt;Before diving into HTTPS, make sure you’ve completed the hardening steps covered in my first guide:&lt;br&gt;
&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/8084/fortify-your-digitalocean-droplet-a-step-by-step-security-guide-for-ubuntu-24-04&quot;&gt;Fortify Your DigitalOcean Droplet: A Step-by-Step Security Guide for Ubuntu 24.04&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-what-you-ll-accomplish-1&quot;&gt;✨ What You’ll Accomplish&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Connect your domain to the droplet&lt;/li&gt;
&lt;li&gt;Configure Nginx properly for production&lt;/li&gt;
&lt;li&gt;Install Certbot + Let’s Encrypt&lt;/li&gt;
&lt;li&gt;Enable secure HTTPS with automatic renewal&lt;/li&gt;
&lt;li&gt;Redirect all HTTP traffic to HTTPS&lt;/li&gt;
&lt;li&gt;Validate the setup with a clean, secure padlock indicator&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every step — with the exact commands — is included in the full guide.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;why-https-matters&quot;&gt;Why HTTPS Matters&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Protects login and API endpoints&lt;/li&gt;
&lt;li&gt;Encrypts form data, cookies, and tokens&lt;/li&gt;
&lt;li&gt;Immediately boosts user trust&lt;/li&gt;
&lt;li&gt;Required by OAuth providers, Stripe, Clerk, Firebase, and more&lt;/li&gt;
&lt;li&gt;Works seamlessly with any backend (Laravel, Node.js, Go, Spring Boot, etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whether you're deploying a portfolio, SaaS app, REST API, or production service, &lt;strong&gt;HTTPS is non-negotiable&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;read-the-full-detailed-guide-1&quot;&gt;Read the Full, Detailed Guide&lt;/h3&gt;
&lt;p&gt;The complete command-by-command walkthrough — including explanations, and best practices — is available on my blog.&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;Read the full article here:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://insafnilam.hashnode.dev/fortify-your-droplet-unlock-free-https-with-lets-encrypt-ssl&quot;&gt;Fortify Your Droplet: Unlock Free HTTPS with Let’s Encrypt SSL&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;(Every command and configuration is included — nothing hidden.)&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;after-you-follow-the-guide-your-droplet-will-be-&quot;&gt;After You Follow the Guide, Your Droplet Will Be:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;✅ Fully encrypted with HTTPS&lt;/li&gt;
&lt;li&gt;✅ Protected from MITM attacks&lt;/li&gt;
&lt;li&gt;✅ Auto-renewing SSL forever&lt;/li&gt;
&lt;li&gt;✅ Ready for real production workloads&lt;/li&gt;
&lt;li&gt;✅ Safe for sessions, passwords, and API traffic&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>App Security</category>
<guid isPermaLink="true">https://coderlegion.com/8116/secure-your-digitalocean-droplet-with-free-https-lets-encrypt-certbot</guid>
<pubDate>Wed, 03 Dec 2025 07:59:56 +0000</pubDate>
</item>
<item>
<title>Fortify Your DigitalOcean Droplet: A Step-by-Step Security Guide for Ubuntu 24.04</title>
<link>https://coderlegion.com/8084/fortify-your-digitalocean-droplet-a-step-by-step-security-guide-for-ubuntu-24-04</link>
<description>&lt;p&gt;Launching a production app isn’t just about clean code or beautiful UI — it’s about making sure the server behind it is hardened, protected, and ready for real-world traffic. A poorly configured droplet can be compromised in minutes, and the cost of recovery is far greater than the cost of prevention.&lt;/p&gt;
&lt;p&gt;To help fellow developers avoid those risks, I documented the exact hardening process I used for &lt;strong&gt;azan.lk&lt;/strong&gt;, a Sri Lanka–focused Islamic portal. These steps apply to any project — personal, client-based, or fully commercial.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-you-ll-achieve&quot;&gt;What You’ll Achieve&lt;/h3&gt;
&lt;p&gt;By the end of this guide, you’ll have a droplet that’s:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hardened and production-ready&lt;/li&gt;
&lt;li&gt;Protected with SSH key–only access&lt;/li&gt;
&lt;li&gt;Locked down with root login disabled&lt;/li&gt;
&lt;li&gt;Secured with a properly configured UFW firewall&lt;/li&gt;
&lt;li&gt;Reinforced with optional tools like Fail2Ban and unattended security updates&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These are foundational steps I recommend before deploying &lt;strong&gt;any&lt;/strong&gt; backend, frontend, Docker service, or microservice.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-this-guide-covers&quot;&gt;What This Guide Covers&lt;/h3&gt;
&lt;h4 id=&quot;1-organizing-your-digitalocean-project&quot;&gt;&lt;strong&gt;1. Organizing Your DigitalOcean Project&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Set up a clean DO workspace so your droplets, DNS records, metrics, and backups stay organized.&lt;/p&gt;
&lt;h4 id=&quot;2-building-a-secure-droplet&quot;&gt;&lt;strong&gt;2. Building a Secure Droplet&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Recommended specs for most apps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ubuntu 24.04 LTS&lt;/li&gt;
&lt;li&gt;2GB RAM / 2 CPU&lt;/li&gt;
&lt;li&gt;60GB SSD&lt;/li&gt;
&lt;li&gt;Singapore or Bangalore for low latency to Sri Lanka&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;3-ssh-amp-user-configuration&quot;&gt;&lt;strong&gt;3. SSH &amp;amp; User Configuration&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Create a non-root sudo user&lt;/li&gt;
&lt;li&gt;Add SSH key authentication&lt;/li&gt;
&lt;li&gt;Disable password login&lt;/li&gt;
&lt;li&gt;Disable root login for safety&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-hardening-essentials&quot;&gt;&lt;strong&gt;4. Hardening Essentials&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Strengthen your droplet with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Strict SSH configuration&lt;/li&gt;
&lt;li&gt;UFW firewall&lt;/li&gt;
&lt;li&gt;Fail2Ban jail protection&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;5-developer-quality-of-life-enhancements&quot;&gt;&lt;strong&gt;5. Developer Quality-of-Life Enhancements&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Set up a local SSH config so logging into your droplet becomes instant and password-free.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-why-i-wrote-this&quot;&gt;✨ Why I Wrote This&lt;/h3&gt;
&lt;p&gt;When I first started deploying production systems, server security felt like something for “later.”&lt;br&gt;
Then I learned how vulnerable a fresh droplet is out of the box — and how quickly it can be scanned, probed, or exploited.&lt;/p&gt;
&lt;p&gt;Now I document my setup processes so other developers can deploy with confidence and avoid the pitfalls I learned the hard way.&lt;/p&gt;
&lt;p&gt;This article is perfect if you’re deploying:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Laravel, Node.js, or Go applications&lt;/li&gt;
&lt;li&gt;React, Vue, or Next.js frontends&lt;/li&gt;
&lt;li&gt;Docker containers / microservices&lt;/li&gt;
&lt;li&gt;APIs or production websites&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;read-the-full-detailed-guide-2&quot;&gt;Read the Full, Detailed Guide&lt;/h3&gt;
&lt;p&gt;The complete command-by-command walkthrough — including explanations, and best practices — is available on my blog.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Read the full article here:&lt;/strong&gt;&lt;br&gt;
 &lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://insafnilam.hashnode.dev/fortify-your-digitalocean-droplet-a-step-by-step-security-guide-for-ubuntu-2404&quot;&gt;Fortify Your DigitalOcean Droplet: A Step-by-Step Security Guide for Ubuntu 24.04&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;(Every command and configuration is included — nothing hidden.)&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;final-thoughts-1&quot;&gt;Final Thoughts&lt;/h3&gt;
&lt;p&gt;Security isn’t a one-time task — it’s an ongoing practice.&lt;br&gt;
But this guide gives you a &lt;strong&gt;solid, battle-tested foundation&lt;/strong&gt; for any production environment, whether you’re hosting a small personal app or a full-scale platform.&lt;/p&gt;
</description>
<category>App Security</category>
<guid isPermaLink="true">https://coderlegion.com/8084/fortify-your-digitalocean-droplet-a-step-by-step-security-guide-for-ubuntu-24-04</guid>
<pubDate>Tue, 02 Dec 2025 18:54:08 +0000</pubDate>
</item>
</channel>
</rss>