<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Carlos Orue</title>
    <description>The latest articles on DEV Community by Carlos Orue (@orue).</description>
    <link>https://dev.to/orue</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F279051%2F94988601-91c2-4ceb-bad3-4404fbf34178.jpg</url>
      <title>DEV Community: Carlos Orue</title>
      <link>https://dev.to/orue</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/orue"/>
    <language>en</language>
    <item>
      <title>Deploy Python Apps Without the Cloud Complexity: A Practical Ubuntu Server Guide</title>
      <dc:creator>Carlos Orue</dc:creator>
      <pubDate>Wed, 19 Nov 2025 19:57:40 +0000</pubDate>
      <link>https://dev.to/orue/deploy-python-apps-without-the-cloud-complexity-a-practical-ubuntu-server-guide-mcb</link>
      <guid>https://dev.to/orue/deploy-python-apps-without-the-cloud-complexity-a-practical-ubuntu-server-guide-mcb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; Carlos Orue&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 1 of 3: Base System Setup&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Series Overview
&lt;/h2&gt;

&lt;p&gt;This is the first article in a three-part series on deploying production-ready applications on Ubuntu Server 24.04 LTS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Part 1: Ubuntu Installation and Base Setup&lt;/strong&gt; (this article) - Deploy and configure a secure Ubuntu Server foundation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Part 2: Docker and Container Management&lt;/strong&gt; (coming soon) - Set up Docker for containerized application deployment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Part 3: CI/CD for Python Applications&lt;/strong&gt; (coming soon) - Automate testing and deployment with modern CI/CD pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Ubuntu Server 24.04 LTS (Noble Numbat) has become the gold standard for cloud Virtual Private Server (VPS) deployments. Whether you're deploying a personal project, launching a startup, or managing production infrastructure, Ubuntu LTS releases provide the reliability, security, and ecosystem support needed for modern applications.&lt;/p&gt;

&lt;p&gt;This guide focuses on deploying a rock-solid Ubuntu Server 24.04 LTS foundation on cloud VPS providersâ€”specifically DigitalOcean, Linode, and Hetzner. We'll leverage automated configuration scripts to ensure consistency, security, and developer productivity from day one.&lt;/p&gt;

&lt;p&gt;By the end of this guide, you'll have a secure, optimized Ubuntu server ready for containerized applications (covered in Part 2) and automated deployments (covered in Part 3).&lt;/p&gt;

&lt;h3&gt;
  
  
  Acknowledgments
&lt;/h3&gt;

&lt;p&gt;This guide is inspired by the practical insights from Michael Kennedy's excellent book &lt;a href="https://talkpython.fm/books/python-in-production" rel="noopener noreferrer"&gt;&lt;strong&gt;Talk Python in Production&lt;/strong&gt;&lt;/a&gt;. His real-world experience running TalkPython and the philosophy that &lt;strong&gt;big, complex cloud infrastructure isn't necessary for every project&lt;/strong&gt; has been invaluable. You don't need Kubernetes clusters and complex managed services to build reliable, production-ready applicationsâ€”a well-configured Ubuntu VPS can be powerful, cost-effective, and much simpler to manage. Thank you, Michael, for sharing these insights with the developer community!&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Choose Ubuntu for Your Cloud VPS?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Market Leadership and Proven Track Record
&lt;/h3&gt;

&lt;p&gt;Ubuntu Server dominates the cloud landscape for good reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Market Share Leader&lt;/strong&gt; - Ubuntu powers over 40% of cloud instances worldwide&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Default Choice&lt;/strong&gt; - Most cloud providers list Ubuntu as their recommended Linux distribution&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Battle-Tested&lt;/strong&gt; - Over 20 years of Canonical's development and refinement since 2004&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production Proven&lt;/strong&gt; - Powers infrastructure at organizations from startups to Fortune 500 companies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Long Term Support (LTS) Advantages
&lt;/h3&gt;

&lt;p&gt;The LTS release model provides critical benefits for server deployments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Extended Security Updates&lt;/strong&gt; - 5 years of free security patches and critical bug fixes (until April 2029)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Predictable Release Cycle&lt;/strong&gt; - New LTS versions every 2 years (April of even-numbered years)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upgrade Path&lt;/strong&gt; - Well-documented upgrade procedures between LTS releases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production Stability&lt;/strong&gt; - Packages are thoroughly tested and optimized for reliability over bleeding-edge features&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extended Support Options&lt;/strong&gt; - Ubuntu Pro extends support to 10 years for compliance-critical environments&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Superior Documentation and Community Support
&lt;/h3&gt;

&lt;p&gt;One of Ubuntu's strongest advantages is its ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Comprehensive Documentation&lt;/strong&gt; - Official guides cover nearly every use case&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Massive Community&lt;/strong&gt; - Largest Linux community means answers are readily available&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stack Overflow Presence&lt;/strong&gt; - More questions and answers than any other server distribution&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tutorial Abundance&lt;/strong&gt; - Third-party guides and tutorials for virtually any stack or application&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active Forums&lt;/strong&gt; - AskUbuntu and official forums provide quick community assistance&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cloud-Native Optimization
&lt;/h3&gt;

&lt;p&gt;Ubuntu Server is specifically optimized for cloud environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud-Init Integration&lt;/strong&gt; - Industry-standard tool for instance initialization and configuration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minimal Cloud Images&lt;/strong&gt; - Streamlined images designed specifically for cloud deployment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast Boot Times&lt;/strong&gt; - Optimized for rapid scaling and instance startup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Official Images&lt;/strong&gt; - Canonical maintains official images for all major cloud providers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container-Friendly&lt;/strong&gt; - Excellent Docker, Kubernetes, and LXD support out of the box (we'll leverage Docker in Part 2)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Developer-Friendly Environment
&lt;/h3&gt;

&lt;p&gt;Ubuntu Server excels as a development and deployment platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Modern Tooling&lt;/strong&gt; - Latest versions of Python, Node.js, Go, and other languages readily available&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wide Software Support&lt;/strong&gt; - Most server software provides Ubuntu as tier-1 supported platform&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Localhost-Production Parity&lt;/strong&gt; - Easy to match cloud server environment locally with Ubuntu Desktop or WSL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripting and Automation&lt;/strong&gt; - Bash and Python pre-installed; excellent Ansible and Terraform support&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Integration&lt;/strong&gt; - Default choice for GitHub Actions, GitLab CI, and other platforms (covered in Part 3)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security-First Design
&lt;/h3&gt;

&lt;p&gt;Security is built into Ubuntu Server's foundation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Regular Security Updates&lt;/strong&gt; - Timely patches for vulnerabilities, often same-day for critical issues&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unattended Upgrades&lt;/strong&gt; - Automatic security update capability built-in&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AppArmor by Default&lt;/strong&gt; - Mandatory access control active for key services&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Hardening&lt;/strong&gt; - CIS and DISA STIG benchmarks available&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active Security Team&lt;/strong&gt; - Canonical's dedicated security team provides rapid CVE responses&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cost Effectiveness
&lt;/h3&gt;

&lt;p&gt;Ubuntu Server provides exceptional value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero Licensing Costs&lt;/strong&gt; - Completely free for unlimited commercial and personal use&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lower Support Costs&lt;/strong&gt; - Extensive documentation reduces support burden&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Resource Usage&lt;/strong&gt; - Run more workloads on less infrastructure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update Automation&lt;/strong&gt; - Reduces manual maintenance overhead&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community Solutions&lt;/strong&gt; - Most problems already solved and documented online&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Ubuntu Over Other Distributions?
&lt;/h3&gt;

&lt;p&gt;While distributions like Debian, CentOS/Rocky Linux, and Alpine have their merits, Ubuntu offers unique advantages for our use case:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;More Frequent Updates&lt;/strong&gt; - Newer package versions than Debian Stable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better Cloud Integration&lt;/strong&gt; - Superior cloud-init and cloud-provider tooling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Larger Community&lt;/strong&gt; - More readily available solutions and tutorials&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easier Learning Curve&lt;/strong&gt; - More beginner-friendly than minimal distributions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commercial Backing&lt;/strong&gt; - Canonical's support provides accountability&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistent Experience&lt;/strong&gt; - Identical environment across local development and production servers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Optimization&lt;/strong&gt; - Excellent container support (critical for Part 2 of this series)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Choosing Your Cloud Provider
&lt;/h2&gt;

&lt;p&gt;For this series, we focus on three developer-friendly cloud providers that offer excellent value, simplicity, and performance without the complexity of enterprise cloud platforms.&lt;/p&gt;

&lt;h3&gt;
  
  
  DigitalOcean
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Developers, startups, and straightforward deployments&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pricing:&lt;/strong&gt; Starting at $4-6/month for 1GB RAM instances&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free Tier:&lt;/strong&gt; $200 credit for new accounts (typically 60 days)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strengths:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Extremely simple, intuitive interface&lt;/li&gt;
&lt;li&gt;Excellent documentation and tutorials&lt;/li&gt;
&lt;li&gt;Fast SSD-only storage&lt;/li&gt;
&lt;li&gt;Predictable, transparent pricing&lt;/li&gt;
&lt;li&gt;One-click applications and automated backups&lt;/li&gt;
&lt;li&gt;Strong community resources&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Data Centers:&lt;/strong&gt; 15+ global locations&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Why Choose DO:&lt;/strong&gt; If you want simplicity and excellent documentation, DigitalOcean is hard to beat&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Linode (Akamai)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Performance-focused deployments with global reach&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pricing:&lt;/strong&gt; Starting at $5/month for 1GB RAM instances&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free Tier:&lt;/strong&gt; $100 credit for new accounts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strengths:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Excellent price-to-performance ratio&lt;/li&gt;
&lt;li&gt;High-performance network backbone (Akamai acquisition)&lt;/li&gt;
&lt;li&gt;Transparent, consistent pricing&lt;/li&gt;
&lt;li&gt;24/7 human support&lt;/li&gt;
&lt;li&gt;Generous bandwidth allocations&lt;/li&gt;
&lt;li&gt;Strong focus on infrastructure reliability&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Data Centers:&lt;/strong&gt; 25+ global locations&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Why Choose Linode:&lt;/strong&gt; If you prioritize performance and global presence, Linode delivers exceptional value&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hetzner Cloud
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Cost-conscious deployments, especially for US and European audiences&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pricing:&lt;/strong&gt; Starting at $4.09/month for 2GB RAM instances (best value)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strengths:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Exceptional price-to-performance ratio&lt;/li&gt;
&lt;li&gt;Higher specs for lower prices&lt;/li&gt;
&lt;li&gt;Excellent network infrastructure&lt;/li&gt;
&lt;li&gt;Strong European data center presence&lt;/li&gt;
&lt;li&gt;Environmentally conscious (green energy)&lt;/li&gt;
&lt;li&gt;Simple, clean interface&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Data Centers:&lt;/strong&gt; US (Ashburn, Hillsboro) and European locations (Germany, Finland)&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Why Choose Hetzner:&lt;/strong&gt; If cost efficiency is your priority, Hetzner offers the best value in the market&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quick Comparison
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Starting Price&lt;/th&gt;
&lt;th&gt;RAM/CPU&lt;/th&gt;
&lt;th&gt;Storage&lt;/th&gt;
&lt;th&gt;Transfer&lt;/th&gt;
&lt;th&gt;Free Credit&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DigitalOcean&lt;/td&gt;
&lt;td&gt;$4-6/mo&lt;/td&gt;
&lt;td&gt;1GB / 1 vCPU&lt;/td&gt;
&lt;td&gt;25GB SSD&lt;/td&gt;
&lt;td&gt;1TB&lt;/td&gt;
&lt;td&gt;$200&lt;/td&gt;
&lt;td&gt;Simplicity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linode&lt;/td&gt;
&lt;td&gt;$5/mo&lt;/td&gt;
&lt;td&gt;1GB / 1 vCPU&lt;/td&gt;
&lt;td&gt;25GB SSD&lt;/td&gt;
&lt;td&gt;1TB&lt;/td&gt;
&lt;td&gt;$100&lt;/td&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hetzner&lt;/td&gt;
&lt;td&gt;$4.09/mo&lt;/td&gt;
&lt;td&gt;2GB / 1 vCPU&lt;/td&gt;
&lt;td&gt;20GB SSD&lt;/td&gt;
&lt;td&gt;20TB&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Value&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Prices as of October 2025. Always check current pricing.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Our Recommendation
&lt;/h3&gt;

&lt;p&gt;For this tutorial series, any of these three providers will work perfectly. If you're just starting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Choose DigitalOcean&lt;/strong&gt; if you're new to VPS and want the easiest experience&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose Linode&lt;/strong&gt; if you need global data centers and premium performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose Hetzner&lt;/strong&gt; if you want maximum value and higher specs for your budget&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All three offer Ubuntu Server 24.04 LTS as a one-click deployment option and support the configurations we'll use throughout this series.&lt;/p&gt;

&lt;h3&gt;
  
  
  Beyond These Providers
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Important Note:&lt;/strong&gt; While this guide focuses on DigitalOcean, Linode, and Hetzner for their simplicity and value, the setup instructions apply equally well to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enterprise Cloud Providers&lt;/strong&gt; - AWS EC2, Azure Virtual Machines, or Google Compute Engine instances running Ubuntu Server 24.04 LTS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local/On-Premise Servers&lt;/strong&gt; - Physical servers or VMs in your own data center or office&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other VPS Providers&lt;/strong&gt; - Vultr, OVH, Scaleway, or any provider offering Ubuntu Server 24.04 LTS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The beauty of this approach is its portabilityâ€”Ubuntu Server behaves consistently regardless of where it runs. The same configuration scripts, security hardening, and deployment strategies work everywhere. Whether you're starting on a $5/month VPS or inheriting an enterprise cloud account, these fundamentals remain the same.&lt;/p&gt;




&lt;h2&gt;
  
  
  Deploying Your VPS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Create Your VPS Instance
&lt;/h3&gt;

&lt;p&gt;The exact process varies slightly by provider, but generally involves:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sign up and log into your provider's dashboard&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DigitalOcean: cloud.digitalocean.com&lt;/li&gt;
&lt;li&gt;Linode: cloud.linode.com&lt;/li&gt;
&lt;li&gt;Hetzner: console.hetzner.cloud&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a new instance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DigitalOcean: "Create" â†’ "Droplets"&lt;/li&gt;
&lt;li&gt;Linode: "Create" â†’ "Linode"&lt;/li&gt;
&lt;li&gt;Hetzner: "New Project" â†’ "Add Server"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Select Ubuntu Server 24.04 LTS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Look for "Ubuntu 24.04 LTS" in the operating system options&lt;/li&gt;
&lt;li&gt;Ensure it's the LTS version (not interim releases)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Choose your server size&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;For development/testing:&lt;/strong&gt; 1-2GB RAM is sufficient&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For production applications:&lt;/strong&gt; Start with 2-4GB RAM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For this tutorial:&lt;/strong&gt; 1-2GB is perfect (you can always upgrade later)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Select a region/data center&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose a location closest to your users&lt;/li&gt;
&lt;li&gt;For US: NYC, San Francisco, or Ashburn&lt;/li&gt;
&lt;li&gt;For Europe: Frankfurt, London, or Helsinki&lt;/li&gt;
&lt;li&gt;Lower latency = better user experience&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure SSH authentication&lt;/strong&gt; (IMPORTANT)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recommended method:&lt;/strong&gt; Upload your SSH public key during creation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alternative:&lt;/strong&gt; Use password authentication (we'll disable this after setup)&lt;/li&gt;
&lt;li&gt;If you don't have SSH keys yet, we'll create them in the next section&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Optional configurations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable automated backups (recommended for production)&lt;/li&gt;
&lt;li&gt;Add monitoring/alerts&lt;/li&gt;
&lt;li&gt;Configure private networking (if needed)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Deploy the instance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click "Create" and wait 30-60 seconds for provisioning&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 2: SSH Key Setup (If Needed)
&lt;/h3&gt;

&lt;p&gt;If you don't have SSH keys yet, create them on your local machine:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On Linux/Mac:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-b&lt;/span&gt; 4096 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;span class="c"&gt;# Press Enter to accept default location (~/.ssh/id_rsa)&lt;/span&gt;
&lt;span class="c"&gt;# Set a passphrase (recommended) or press Enter for no passphrase&lt;/span&gt;

&lt;span class="c"&gt;# Display your public key&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;On Windows (PowerShell):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;ssh-keygen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;rsa&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;4096&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# Press Enter to accept default location&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# Set a passphrase or press Enter&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# Display your public key&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="kr"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;USERPROFILE&lt;/span&gt;&lt;span class="n"&gt;\.ssh\id_rsa.pub&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the entire public key output and add it to your VPS during creation or afterward through the provider's dashboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Initial Connection
&lt;/h3&gt;

&lt;p&gt;Once your VPS is deployed, you'll receive an IP address. Connect via SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh root@your-server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or if you created a non-root user during deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh yourusername@your-server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;First time connecting?&lt;/strong&gt; You'll see a message about host authenticity. Type &lt;code&gt;yes&lt;/code&gt; to continue.&lt;/p&gt;

&lt;p&gt;If you set up SSH keys correctly, you should connect without a password prompt (or with your key passphrase if you set one).&lt;/p&gt;




&lt;h2&gt;
  
  
  Initial System Configuration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Update System Packages
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Always&lt;/strong&gt; start with a full system update. This ensures you have the latest security patches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt autoremove &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command does three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;apt update&lt;/code&gt; - Refreshes the package list&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apt upgrade -y&lt;/code&gt; - Installs all available updates&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apt autoremove -y&lt;/code&gt; - Removes unnecessary packages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reboot to apply kernel and system updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;shutdown now &lt;span class="nt"&gt;-r&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Wait 30-60 seconds&lt;/strong&gt;, then reconnect via SSH.&lt;/p&gt;




&lt;h2&gt;
  
  
  Security Hardening
&lt;/h2&gt;

&lt;p&gt;Security should be your top priority before installing any applications. Let's lock down the server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create an Administrative User
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Many cloud providers create a default admin user automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DigitalOcean: Uses &lt;code&gt;root&lt;/code&gt; by default&lt;/li&gt;
&lt;li&gt;Linode: Uses &lt;code&gt;root&lt;/code&gt; by default&lt;/li&gt;
&lt;li&gt;Hetzner: Can choose username during setup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're logged in as &lt;code&gt;root&lt;/code&gt;, create a dedicated admin account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Replace 'yourusername' with your desired username&lt;/span&gt;
adduser yourusername
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be prompted to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set a password (use a strong one!)&lt;/li&gt;
&lt;li&gt;Enter optional user information (you can press Enter to skip)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add the user to the sudo group for administrative privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;yourusername
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch to your new user to test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;su yourusername
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify sudo access works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cat&lt;/span&gt; /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see the log contents, sudo is working correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure SSH Key Authentication
&lt;/h3&gt;

&lt;p&gt;SSH keys are &lt;strong&gt;significantly&lt;/strong&gt; more secure than password authentication and are essential for automated deployments (which we'll cover in Part 3).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you didn't add SSH keys during VPS creation&lt;/strong&gt;, set them up now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Make sure you're logged in as your new user (not root)&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ~
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.ssh
&lt;span class="nb"&gt;chmod &lt;/span&gt;700 ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create and edit the authorized keys file:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste your public SSH key (the one that starts with &lt;code&gt;ssh-rsa&lt;/code&gt; or &lt;code&gt;ssh-ed25519&lt;/code&gt;), then save:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl+O&lt;/code&gt; to save&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Enter&lt;/code&gt; to confirm&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl+X&lt;/code&gt; to exit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Set correct permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;644 ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Test SSH key authentication BEFORE proceeding:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open a new terminal window (keep your current session open!) and try connecting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh yourusername@your-server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Don't close your original SSH session until you confirm the new connection works!&lt;/p&gt;

&lt;h3&gt;
  
  
  Disable Root Login
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Critical:&lt;/strong&gt; Only perform this step after confirming SSH key authentication works with your regular user account.&lt;/p&gt;

&lt;p&gt;Edit the SSH daemon configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find this line (use &lt;code&gt;Ctrl+W&lt;/code&gt; to search):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PermitRootLogin &lt;span class="nb"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PermitRootLogin no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While you're here, also ensure these settings are configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PasswordAuthentication no
PubkeyAuthentication &lt;span class="nb"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit (&lt;code&gt;Ctrl+O&lt;/code&gt;, &lt;code&gt;Enter&lt;/code&gt;, &lt;code&gt;Ctrl+X&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Restart SSH to apply changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Test immediately:&lt;/strong&gt; Open a new terminal and verify you can still connect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh yourusername@your-server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Configure the Firewall
&lt;/h2&gt;

&lt;p&gt;Ubuntu Server includes UFW (Uncomplicated Firewall), which makes firewall management straightforward.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enable UFW
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Check current firewall status:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CRITICAL: Allow SSH BEFORE enabling the firewall:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 22/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you changed the SSH port earlier, allow that port instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow your-custom-port/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Enable the firewall:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type &lt;code&gt;y&lt;/code&gt; when prompted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify it's active:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status verbose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Status: active
To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configure Ports for Your Applications
&lt;/h3&gt;

&lt;p&gt;We'll add more firewall rules as we progress through the series:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For web applications (we'll use these in Parts 2 and 3):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# HTTP&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 80/tcp

&lt;span class="c"&gt;# HTTPS&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 443/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For custom application ports:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 8080/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;View all active rules:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status numbered
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;To delete a rule by number:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw delete &lt;span class="o"&gt;[&lt;/span&gt;number]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Automated Configuration Setup
&lt;/h2&gt;

&lt;p&gt;Now that your server is secure, let's set up an optimized development environment using automated scripts from the &lt;a href="https://github.com/orue/ubuntu-server-configuration" rel="noopener noreferrer"&gt;ubuntu-server-configuration&lt;/a&gt; repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install Latest Git
&lt;/h3&gt;

&lt;p&gt;Ubuntu's default repositories sometimes lag behind. Install the latest Git from the official PPA:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/install-git.sh | &lt;span class="nb"&gt;sudo &lt;/span&gt;bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the official Git PPA repository&lt;/li&gt;
&lt;li&gt;Install the latest stable Git version&lt;/li&gt;
&lt;li&gt;Verify the installation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Verify the installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see Git 2.40 or newer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install Custom Dotfiles
&lt;/h3&gt;

&lt;p&gt;Deploy optimized configurations for Bash, Vim, and Git:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sSL&lt;/span&gt; https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/dotfiles.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This automated script installs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.bashrc&lt;/code&gt;&lt;/strong&gt; - Custom aliases, functions, and enhanced prompt for productivity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.vimrc&lt;/code&gt;&lt;/strong&gt; - Optimized Vim editor configuration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.gitconfig&lt;/code&gt;&lt;/strong&gt; - Git aliases and workflow improvements (essential for Part 3)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; These dotfiles are optional but highly recommended. They include good practices and useful aliases and shortcuts for server administration and file editing that can significantly improve your productivity when working on the server.&lt;/p&gt;

&lt;p&gt;Your existing files are automatically backed up before installation to &lt;code&gt;~/.dotfiles_backup/&lt;/code&gt;, keeping only the last 3 versions of each file to manage disk space efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customize Git Configuration
&lt;/h3&gt;

&lt;p&gt;Set your Git identity (required for commits):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"you@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify your Git configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What Do the Dotfiles Include?
&lt;/h3&gt;

&lt;p&gt;The custom dotfiles provide developer-friendly enhancements:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bash Aliases&lt;/strong&gt; (see full reference: &lt;a href="https://github.com/orue/ubuntu-server-configuration/blob/main/bashrc-aliases-reference.md" rel="noopener noreferrer"&gt;bashrc-aliases-reference.md&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ll&lt;/code&gt; - Enhanced directory listing with colors&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;la&lt;/code&gt; - Show all files including hidden&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;..&lt;/code&gt; and &lt;code&gt;...&lt;/code&gt; - Quick directory navigation&lt;/li&gt;
&lt;li&gt;Git shortcuts like &lt;code&gt;gs&lt;/code&gt;, &lt;code&gt;ga&lt;/code&gt;, &lt;code&gt;gc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;System monitoring aliases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Vim Configuration&lt;/strong&gt; (see full reference: &lt;a href="https://github.com/orue/ubuntu-server-configuration/blob/main/vim-keymapping-cheatsheet.md" rel="noopener noreferrer"&gt;vim-keymapping-cheatsheet.md&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Syntax highlighting enabled&lt;/li&gt;
&lt;li&gt;Line numbers and ruler&lt;/li&gt;
&lt;li&gt;Smart indentation&lt;/li&gt;
&lt;li&gt;Better search settings&lt;/li&gt;
&lt;li&gt;Custom keybindings for efficiency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Git Configuration&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Useful aliases for common operations&lt;/li&gt;
&lt;li&gt;Better diff and merge tools&lt;/li&gt;
&lt;li&gt;Colored output&lt;/li&gt;
&lt;li&gt;Helpful defaults for modern workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Apply Configuration Changes
&lt;/h3&gt;

&lt;p&gt;Reload your bash configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or simply disconnect and reconnect to see the changes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Enable Automatic Security Updates
&lt;/h2&gt;

&lt;p&gt;Keep your server secure with automated security updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;unattended-upgrades &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This package is usually pre-installed on Ubuntu, but this ensures it's available.&lt;/p&gt;

&lt;p&gt;Enable the service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg-reconfigure &lt;span class="nt"&gt;--priority&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;low unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select "Yes" when prompted to enable automatic updates.&lt;/p&gt;

&lt;p&gt;This configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatically installs security updates&lt;/li&gt;
&lt;li&gt;Requires manual approval for feature updates&lt;/li&gt;
&lt;li&gt;Reduces the risk of running unpatched software&lt;/li&gt;
&lt;li&gt;Balances security with stability&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Verify Unattended Upgrades Configuration
&lt;/h3&gt;

&lt;p&gt;Check the status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;View the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/apt/apt.conf.d/50unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Verify Your Configuration
&lt;/h2&gt;

&lt;p&gt;After all setup steps, verify everything is working correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check Git version&lt;/span&gt;
git &lt;span class="nt"&gt;--version&lt;/span&gt;

&lt;span class="c"&gt;# Test custom aliases&lt;/span&gt;
ll  &lt;span class="c"&gt;# Should show colorized directory listing&lt;/span&gt;

&lt;span class="c"&gt;# Check automatic updates status&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status unattended-upgrades

&lt;span class="c"&gt;# Verify firewall is active&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status

&lt;span class="c"&gt;# Check system resources&lt;/span&gt;
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;  &lt;span class="c"&gt;# Disk space&lt;/span&gt;
free &lt;span class="nt"&gt;-h&lt;/span&gt;  &lt;span class="c"&gt;# Memory usage&lt;/span&gt;

&lt;span class="c"&gt;# View system information&lt;/span&gt;
&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
lsb_release &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Essential Monitoring Commands
&lt;/h2&gt;

&lt;p&gt;Now that your server is configured, familiarize yourself with these essential monitoring commands:&lt;/p&gt;

&lt;h3&gt;
  
  
  System Resources
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install htop for better resource monitoring&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;htop &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# Interactive process viewer&lt;/span&gt;
htop

&lt;span class="c"&gt;# Check disk usage&lt;/span&gt;
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;

&lt;span class="c"&gt;# Check directory sizes&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /var/log/&lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="c"&gt;# Check memory usage&lt;/span&gt;
free &lt;span class="nt"&gt;-h&lt;/span&gt;

&lt;span class="c"&gt;# View system uptime and load&lt;/span&gt;
&lt;span class="nb"&gt;uptime&lt;/span&gt;

&lt;span class="c"&gt;# View running processes&lt;/span&gt;
ps aux | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;

&lt;span class="c"&gt;# Find processes by name&lt;/span&gt;
ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  System Logs
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# View recent system events&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-xe&lt;/span&gt;

&lt;span class="c"&gt;# Follow authentication logs (useful for monitoring SSH attempts)&lt;/span&gt;
&lt;span class="nb"&gt;sudo tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/auth.log

&lt;span class="c"&gt;# Check for errors in current boot&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-p&lt;/span&gt; err &lt;span class="nt"&gt;-b&lt;/span&gt;

&lt;span class="c"&gt;# View kernel messages&lt;/span&gt;
dmesg | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-50&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Service Management
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check SSH service status&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status ssh

&lt;span class="c"&gt;# View all running services&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl list-units &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service &lt;span class="nt"&gt;--state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;running

&lt;span class="c"&gt;# View all failed services&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nt"&gt;--failed&lt;/span&gt;

&lt;span class="c"&gt;# Restart a service&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart &lt;span class="o"&gt;[&lt;/span&gt;service-name]

&lt;span class="c"&gt;# Enable service to start on boot&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;service-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Network Monitoring
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# List all listening ports&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;netstat &lt;span class="nt"&gt;-tlnp&lt;/span&gt;

&lt;span class="c"&gt;# Or using ss (modern alternative)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ss &lt;span class="nt"&gt;-tlnp&lt;/span&gt;

&lt;span class="c"&gt;# Check active network connections&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;netstat &lt;span class="nt"&gt;-an&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;ESTABLISHED

&lt;span class="c"&gt;# View firewall rules&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status numbered

&lt;span class="c"&gt;# Test connectivity&lt;/span&gt;
ping &lt;span class="nt"&gt;-c&lt;/span&gt; 4 google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Troubleshooting Common Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cannot Connect via SSH
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Check if SSH is running:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status ssh
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verify SSH port is open in firewall:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;span class="nb"&gt;sudo &lt;/span&gt;netstat &lt;span class="nt"&gt;-tlnp&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; :22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check SSH configuration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cat&lt;/span&gt; /etc/ssh/sshd_config | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"PermitRootLogin|PasswordAuthentication|Port"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;View SSH logs for connection attempts:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo tail&lt;/span&gt; &lt;span class="nt"&gt;-50&lt;/span&gt; /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  SSH Key Authentication Fails
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Check file permissions (very important!):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; ~/.ssh/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Correct permissions should be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.ssh&lt;/code&gt; directory: &lt;code&gt;drwx------&lt;/code&gt; (700)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;authorized_keys&lt;/code&gt;: &lt;code&gt;-rw-r--r--&lt;/code&gt; (644)&lt;/li&gt;
&lt;li&gt;Private keys: &lt;code&gt;-rw-------&lt;/code&gt; (600)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix permissions if needed:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;700 ~/.ssh
&lt;span class="nb"&gt;chmod &lt;/span&gt;644 ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verify key is in authorized_keys:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Locked Out After Configuration Changes
&lt;/h3&gt;

&lt;p&gt;If you accidentally lock yourself out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use your cloud provider's web console:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DigitalOcean: "Access" â†’ "Launch Droplet Console"&lt;/li&gt;
&lt;li&gt;Linode: "Launch LISH Console"&lt;/li&gt;
&lt;li&gt;Hetzner: "Console" button in server details&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Log in via the web terminal&lt;/strong&gt; (usually as root)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fix the configuration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="c"&gt;# Re-enable root login temporarily&lt;/span&gt;
   &lt;span class="nb"&gt;sudo sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/PermitRootLogin no/PermitRootLogin yes/'&lt;/span&gt; /etc/ssh/sshd_config
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prevention:&lt;/strong&gt; Always test SSH access in a new terminal before disconnecting!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  System Running Slow
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Check resource usage:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# CPU and memory&lt;/span&gt;
htop

&lt;span class="c"&gt;# Disk space (full disks cause major issues)&lt;/span&gt;
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;

&lt;span class="c"&gt;# Check for large files/directories&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /&lt;span class="k"&gt;*&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;

&lt;span class="c"&gt;# View processes by memory usage&lt;/span&gt;
ps aux &lt;span class="nt"&gt;--sort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-%mem | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-10&lt;/span&gt;

&lt;span class="c"&gt;# View processes by CPU usage&lt;/span&gt;
ps aux &lt;span class="nt"&gt;--sort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-%cpu | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Package Installation Fails
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Fix broken packages:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nt"&gt;--fix-broken&lt;/span&gt; &lt;span class="nb"&gt;install
sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;--configure&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clear package cache if needed:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt clean
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt autoclean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Disk Space Issues
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Find large files:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Find files larger than 100MB&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;find / &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-size&lt;/span&gt; +100M 2&amp;gt;/dev/null

&lt;span class="c"&gt;# Check log sizes&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /var/log/&lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="c"&gt;# Clean old logs&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;--vacuum-time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;7d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clean up system:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt autoremove &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Additional Security Hardening (Optional)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install Fail2Ban
&lt;/h3&gt;

&lt;p&gt;Protect against brute-force SSH attacks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;fail2ban
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check status and banned IPs:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;fail2ban-client status sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;View banned IPs:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;fail2ban-client status sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fail2Ban automatically bans IPs after multiple failed login attempts, adding an extra layer of security.&lt;/p&gt;

&lt;h3&gt;
  
  
  Change Default SSH Port (Optional)
&lt;/h3&gt;

&lt;p&gt;Changing the SSH port can reduce automated attack attempts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit SSH configuration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find and change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#Port 22&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To (use a port above 1024 and below 65535):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Port 2222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Update firewall rules:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 2222/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw delete allow 22/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test the new port in a new terminal before closing your current session!&lt;/li&gt;
&lt;li&gt;Remember to use &lt;code&gt;ssh -p 2222 user@server-ip&lt;/code&gt; from now on&lt;/li&gt;
&lt;li&gt;Update your CI/CD configurations in Part 3 with the new port&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick Start Summary
&lt;/h2&gt;

&lt;p&gt;For copy-paste convenience, here's the complete setup sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Update the system&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt autoremove &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;shutdown now &lt;span class="nt"&gt;-r&lt;/span&gt;

&lt;span class="c"&gt;# 2. Create admin user (if needed)&lt;/span&gt;
adduser yourusername
usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;yourusername

&lt;span class="c"&gt;# 3. Configure SSH keys for your user&lt;/span&gt;
&lt;span class="c"&gt;# (Copy your public key to ~/.ssh/authorized_keys)&lt;/span&gt;

&lt;span class="c"&gt;# 4. Disable root login and password authentication&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;span class="c"&gt;# Set: PermitRootLogin no&lt;/span&gt;
&lt;span class="c"&gt;# Set: PasswordAuthentication no&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh

&lt;span class="c"&gt;# 5. Configure firewall&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 22/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 80/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 443/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;

&lt;span class="c"&gt;# 6. Install latest Git&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/install-git.sh | &lt;span class="nb"&gt;sudo &lt;/span&gt;bash

&lt;span class="c"&gt;# 7. Install custom dotfiles&lt;/span&gt;
curl &lt;span class="nt"&gt;-sSL&lt;/span&gt; https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/dotfiles.sh | bash

&lt;span class="c"&gt;# 8. Customize Git configuration&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"you@example.com"&lt;/span&gt;

&lt;span class="c"&gt;# 9. Enable automatic security updates&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;unattended-upgrades &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg-reconfigure &lt;span class="nt"&gt;--priority&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;low unattended-upgrades

&lt;span class="c"&gt;# 10. Install optional security tools&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;htop fail2ban &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# 11. Verify configuration&lt;/span&gt;
git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status ssh
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; free &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What's Next: Docker and Containerization
&lt;/h2&gt;

&lt;p&gt;With your Ubuntu Server 24.04 LTS properly configured, you now have a secure, optimized foundation ready for application deployment.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Part 2 of this series&lt;/strong&gt;, we'll cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker Installation and Configuration&lt;/strong&gt; - Set up Docker Engine for containerized deployments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose&lt;/strong&gt; - Manage multi-container applications with ease&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container Security&lt;/strong&gt; - Best practices for running secure containers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistent Storage&lt;/strong&gt; - Manage data volumes and backups&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Networking&lt;/strong&gt; - Configure container networks for complex applications&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Management&lt;/strong&gt; - Limit CPU and memory usage for containers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deploying Your First Application&lt;/strong&gt; - Run a sample Python application in Docker&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why Docker? Containers provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt; - Same environment from development to production&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolation&lt;/strong&gt; - Applications don't interfere with each other&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portability&lt;/strong&gt; - Move applications between servers easily&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt; - Better resource utilization than virtual machines&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Ready&lt;/strong&gt; - Perfect foundation for automated deployments (Part 3)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Regular Maintenance Checklist
&lt;/h2&gt;

&lt;p&gt;To keep your server healthy and secure:&lt;/p&gt;

&lt;h3&gt;
  
  
  Weekly
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Review authentication logs: &lt;code&gt;sudo tail -100 /var/log/auth.log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check disk usage: &lt;code&gt;df -h&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Review failed services: &lt;code&gt;sudo systemctl --failed&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Monitor system load: &lt;code&gt;uptime&lt;/code&gt; and &lt;code&gt;htop&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Monthly
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Check for security updates: &lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt list --upgradable&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Review UFW logs: &lt;code&gt;sudo tail -100 /var/log/ufw.log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Verify backups are running correctly (if configured)&lt;/li&gt;
&lt;li&gt;Review fail2ban banned IPs: &lt;code&gt;sudo fail2ban-client status sshd&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quarterly
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Review and remove unused packages: &lt;code&gt;sudo apt autoremove&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Clean package cache: &lt;code&gt;sudo apt clean&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Review user accounts: &lt;code&gt;cat /etc/passwd&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Update documentation of your server configuration&lt;/li&gt;
&lt;li&gt;Review and rotate logs if needed: &lt;code&gt;sudo journalctl --vacuum-time=30d&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Before Major Updates
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create a snapshot/backup of your VPS&lt;/li&gt;
&lt;li&gt;Test updates in a staging environment if available&lt;/li&gt;
&lt;li&gt;Review release notes for breaking changes&lt;/li&gt;
&lt;li&gt;Ensure you have console access via your provider's web interface&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Cost Optimization Tips
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Right-Size Your Instance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start small&lt;/strong&gt; - Begin with 1-2GB RAM and upgrade as needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor usage&lt;/strong&gt; - Use &lt;code&gt;htop&lt;/code&gt; and &lt;code&gt;df -h&lt;/code&gt; to check actual resource utilization&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Downgrade if needed&lt;/strong&gt; - If consistently under 50% utilization, consider a smaller instance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upgrade when necessary&lt;/strong&gt; - Better to pay for reliable performance than deal with crashes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Provider-Specific Tips
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;DigitalOcean:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use snapshots for backups (cheaper than automated backups for small instances)&lt;/li&gt;
&lt;li&gt;Enable monitoring to track resource usage&lt;/li&gt;
&lt;li&gt;Consider Reserved Instances for long-term projects (20-30% savings)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Linode:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Take advantage of generous bandwidth allocations&lt;/li&gt;
&lt;li&gt;Use backups for production, snapshots for development&lt;/li&gt;
&lt;li&gt;Leverage their object storage for static assets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hetzner:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Already the best value - just don't over-provision&lt;/li&gt;
&lt;li&gt;Use volumes for additional storage (very cost-effective)&lt;/li&gt;
&lt;li&gt;European data centers are often cheaper than US locations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  General Cost-Saving Strategies
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shut down development servers&lt;/strong&gt; when not in use (you only pay while running)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use object storage&lt;/strong&gt; for static files, logs, and backups instead of increasing server storage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable compression&lt;/strong&gt; for web traffic to reduce bandwidth usage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up billing alerts&lt;/strong&gt; at 50%, 75%, and 90% of your budget&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor bandwidth&lt;/strong&gt; - Unexpected spikes might indicate security issues&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate shutdowns&lt;/strong&gt; - Schedule dev/staging servers to turn off overnight&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick Reference Card
&lt;/h2&gt;

&lt;p&gt;Save this for quick access to essential commands:&lt;/p&gt;

&lt;h3&gt;
  
  
  System Management
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Update system&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# Check disk space&lt;/span&gt;
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;

&lt;span class="c"&gt;# Check memory&lt;/span&gt;
free &lt;span class="nt"&gt;-h&lt;/span&gt;

&lt;span class="c"&gt;# System uptime and load&lt;/span&gt;
&lt;span class="nb"&gt;uptime&lt;/span&gt;

&lt;span class="c"&gt;# Restart server&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;reboot

&lt;span class="c"&gt;# Shutdown server&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;shutdown now
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Service Management
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check service status&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status &lt;span class="o"&gt;[&lt;/span&gt;service]

&lt;span class="c"&gt;# Start/stop/restart service&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start|stop|restart &lt;span class="o"&gt;[&lt;/span&gt;service]

&lt;span class="c"&gt;# Enable service at boot&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;service]

&lt;span class="c"&gt;# View all services&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl list-units &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Firewall
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check status&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status verbose

&lt;span class="c"&gt;# Allow port&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow &lt;span class="o"&gt;[&lt;/span&gt;port]/tcp

&lt;span class="c"&gt;# Delete rule&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw delete &lt;span class="o"&gt;[&lt;/span&gt;number]

&lt;span class="c"&gt;# Disable/enable firewall&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw disable|enable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Logs and Monitoring
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# System logs&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-xe&lt;/span&gt;

&lt;span class="c"&gt;# Auth logs (SSH attempts)&lt;/span&gt;
&lt;span class="nb"&gt;sudo tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/auth.log

&lt;span class="c"&gt;# View errors&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-p&lt;/span&gt; err

&lt;span class="c"&gt;# Process monitor&lt;/span&gt;
htop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Network
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Listening ports&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;netstat &lt;span class="nt"&gt;-tlnp&lt;/span&gt;

&lt;span class="c"&gt;# Active connections&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ss &lt;span class="nt"&gt;-tuln&lt;/span&gt;

&lt;span class="c"&gt;# Test connectivity&lt;/span&gt;
ping &lt;span class="nt"&gt;-c&lt;/span&gt; 4 google.com

&lt;span class="c"&gt;# DNS lookup&lt;/span&gt;
nslookup domain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Important File Locations
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/etc/ssh/sshd_config          # SSH configuration
/etc/ufw/                     # Firewall rules
/var/log/                     # System logs
/var/log/auth.log             # Authentication logs
/etc/systemd/system/          # Systemd service files
~/.bashrc                     # Bash configuration
~/.ssh/authorized_keys        # SSH public keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Recommended Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python in Production&lt;/strong&gt; by Michael Kennedy: &lt;a href="https://talkpython.fm/books/python-in-production" rel="noopener noreferrer"&gt;https://talkpython.fm/books/python-in-production&lt;/a&gt; - Essential reading for building production-ready Python applications with practical, no-nonsense deployment strategies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Official Documentation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ubuntu Server 24.04 LTS:&lt;/strong&gt; &lt;a href="https://ubuntu.com/download/server" rel="noopener noreferrer"&gt;https://ubuntu.com/download/server&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ubuntu Server Guide:&lt;/strong&gt; &lt;a href="https://ubuntu.com/server/docs" rel="noopener noreferrer"&gt;https://ubuntu.com/server/docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ubuntu Security Notices:&lt;/strong&gt; &lt;a href="https://ubuntu.com/security/notices" rel="noopener noreferrer"&gt;https://ubuntu.com/security/notices&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Configuration Repository
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/orue/ubuntu-server-configuration" rel="noopener noreferrer"&gt;https://github.com/orue/ubuntu-server-configuration&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bash Aliases Reference:&lt;/strong&gt; &lt;a href="https://github.com/orue/ubuntu-server-configuration/blob/main/bashrc-aliases-reference.md" rel="noopener noreferrer"&gt;bashrc-aliases-reference.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vim Keymapping Cheatsheet:&lt;/strong&gt; &lt;a href="https://github.com/orue/ubuntu-server-configuration/blob/main/vim-keymapping-cheatsheet.md" rel="noopener noreferrer"&gt;vim-keymapping-cheatsheet.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git Setup Guide:&lt;/strong&gt; &lt;a href="https://github.com/orue/ubuntu-server-configuration/blob/main/install-git.md" rel="noopener noreferrer"&gt;install-git.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cloud Provider Documentation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DigitalOcean Community:&lt;/strong&gt; &lt;a href="https://www.digitalocean.com/community/tutorials" rel="noopener noreferrer"&gt;https://www.digitalocean.com/community/tutorials&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linode Guides:&lt;/strong&gt; &lt;a href="https://www.linode.com/docs/" rel="noopener noreferrer"&gt;https://www.linode.com/docs/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hetzner Docs:&lt;/strong&gt; &lt;a href="https://docs.hetzner.com/" rel="noopener noreferrer"&gt;https://docs.hetzner.com/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ubuntu Security:&lt;/strong&gt; &lt;a href="https://ubuntu.com/security" rel="noopener noreferrer"&gt;https://ubuntu.com/security&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fail2Ban:&lt;/strong&gt; &lt;a href="https://github.com/fail2ban/fail2ban" rel="noopener noreferrer"&gt;https://github.com/fail2ban/fail2ban&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UFW Guide:&lt;/strong&gt; &lt;a href="https://help.ubuntu.com/community/UFW" rel="noopener noreferrer"&gt;https://help.ubuntu.com/community/UFW&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations! You've successfully deployed and configured Ubuntu Server 24.04 LTS on a cloud VPS with:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Secure Foundation&lt;/strong&gt; - SSH key authentication, disabled root login, and active firewall&lt;br&gt;
&lt;strong&gt;Automated Updates&lt;/strong&gt; - Unattended security patches to maintain protection&lt;br&gt;
&lt;strong&gt;Optimized Development Environment&lt;/strong&gt; - Latest Git with custom dotfiles for productivity&lt;br&gt;
&lt;strong&gt;Monitoring Capabilities&lt;/strong&gt; - Tools to track server health and performance&lt;br&gt;
&lt;strong&gt;Best Practices&lt;/strong&gt; - Industry-standard security and configuration patterns&lt;/p&gt;

&lt;p&gt;Your server is now production-ready and provides a solid foundation for containerized applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  What We've Accomplished
&lt;/h3&gt;

&lt;p&gt;In this first part of the series, we've established:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A Secure Server&lt;/strong&gt; - Multiple layers of security protect against common attacks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Workflows&lt;/strong&gt; - Custom dotfiles speed up common tasks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Maintenance&lt;/strong&gt; - Security updates happen automatically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring Foundation&lt;/strong&gt; - Tools to understand server health and performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost-Effective Infrastructure&lt;/strong&gt; - Right-sized instance with optimization strategies&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Coming in Part 2: Docker and Containers
&lt;/h3&gt;

&lt;p&gt;In the next article, we'll transform this Ubuntu server into a container host:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install and configure Docker Engine&lt;/li&gt;
&lt;li&gt;Learn Docker fundamentals and best practices&lt;/li&gt;
&lt;li&gt;Deploy multi-container applications with Docker Compose&lt;/li&gt;
&lt;li&gt;Implement container security measures&lt;/li&gt;
&lt;li&gt;Set up persistent storage and networking&lt;/li&gt;
&lt;li&gt;Deploy a sample Python web application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Docker will enable us to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run multiple isolated applications on a single server&lt;/li&gt;
&lt;li&gt;Easily replicate production environments locally&lt;/li&gt;
&lt;li&gt;Simplify application deployment and updates&lt;/li&gt;
&lt;li&gt;Create the foundation for CI/CD pipelines (Part 3)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Coming in Part 3: CI/CD for Python Applications
&lt;/h3&gt;

&lt;p&gt;The final article will complete your deployment pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up GitHub Actions or GitLab CI&lt;/li&gt;
&lt;li&gt;Automate testing and building of Python applications&lt;/li&gt;
&lt;li&gt;Implement automated deployments to your VPS&lt;/li&gt;
&lt;li&gt;Configure zero-downtime deployments&lt;/li&gt;
&lt;li&gt;Set up monitoring and alerting&lt;/li&gt;
&lt;li&gt;Implement rollback strategies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Stay Connected
&lt;/h3&gt;

&lt;p&gt;Follow this series to build a complete, production-ready deployment pipeline. With Ubuntu's 5-year LTS support lifecycle extending until April 2029, you have a stable, predictable platform for your applications.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;About This Guide&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This article is part of a comprehensive series based on best practices and automation scripts from the &lt;a href="https://github.com/orue/ubuntu-server-configuration" rel="noopener noreferrer"&gt;ubuntu-server-configuration&lt;/a&gt; repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Part 1:&lt;/strong&gt; Ubuntu Installation and Base Setup (this article)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Part 2:&lt;/strong&gt; Docker and Container Management (coming soon)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Part 3:&lt;/strong&gt; CI/CD for Python Applications (coming soon)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; Carlos Orue&lt;br&gt;
&lt;strong&gt;Last Updated:&lt;/strong&gt; October 2025&lt;br&gt;
&lt;strong&gt;Covers:&lt;/strong&gt; Ubuntu Server 24.04 LTS (Noble Numbat)&lt;br&gt;
&lt;strong&gt;Target Providers:&lt;/strong&gt; DigitalOcean, Linode, Hetzner Cloud&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; Great infrastructure starts with a solid foundation. Take your time with this setupâ€”every security measure and optimization you implement now will pay dividends as you build and deploy applications in the coming articles.&lt;/p&gt;

&lt;p&gt;Happy deploying!&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>python</category>
      <category>automation</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Making Neovim Your Own: A Practical Guide for VSCode Users</title>
      <dc:creator>Carlos Orue</dc:creator>
      <pubDate>Wed, 12 Nov 2025 16:30:25 +0000</pubDate>
      <link>https://dev.to/orue/making-neovim-your-own-a-practical-guide-for-vscode-users-3f6p</link>
      <guid>https://dev.to/orue/making-neovim-your-own-a-practical-guide-for-vscode-users-3f6p</guid>
      <description>&lt;h2&gt;
  
  
  Making Neovim Your Own
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Repository&lt;/strong&gt;: &lt;a href="https://github.com/orue/config.nvim" rel="noopener noreferrer"&gt;github.com/orue/config.nvim&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  For VSCode users new to Neovim
&lt;/h3&gt;

&lt;p&gt;There are hundreds of YouTube videos and pre-configured Neovim setups out there. But one of Neovim's greatest strengths is how personal you can make it.&lt;/p&gt;

&lt;p&gt;As a beginner, understanding how everything fits together is challenging. Following someone else's configuration might get you started, but it won't feel like &lt;em&gt;your&lt;/em&gt; editor.&lt;/p&gt;

&lt;h3&gt;
  
  
  My approach
&lt;/h3&gt;

&lt;p&gt;My configuration isn't radically different from what you'll find in tutorials—it's just tailored to my workflow and the languages I use: &lt;strong&gt;JavaScript, Python, and Go&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  How I built it:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Started with the fundamentals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I followed &lt;a href="https://youtube.com/playlist?list=PLep05UYkc6wTyBe7kPjQFWVXTlhKeQejM&amp;amp;si=ujIcz-xEn3s6EVFM" rel="noopener noreferrer"&gt;TJ DeVries' tutorial series&lt;/a&gt;. TJ breaks down the basics of &lt;em&gt;how&lt;/em&gt; and &lt;em&gt;why&lt;/em&gt; things work in Neovim. His channel also has Lua tutorials if you're unfamiliar with the language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Customized with Claude CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After understanding the basics, I used Claude CLI to help customize my preferences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Colorschemes that match my style&lt;/li&gt;
&lt;li&gt;LSPs for JavaScript, Python, and Go&lt;/li&gt;
&lt;li&gt;Code formatters&lt;/li&gt;
&lt;li&gt;Documentation for all my keymappings&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The takeaway
&lt;/h3&gt;

&lt;p&gt;The goal isn't to copy my config—it's to show you a path to making Neovim truly yours.&lt;/p&gt;

&lt;p&gt;Feel free to explore, fork, and adapt to your needs.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Tech Stack&lt;/strong&gt;: Neovim, Lua, LSP&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Languages&lt;/strong&gt;: JavaScript, Python, Go&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Repository&lt;/strong&gt;: &lt;a href="https://github.com/orue/config.nvim" rel="noopener noreferrer"&gt;https://github.com/orue/config.nvim&lt;/a&gt;&lt;/p&gt;

</description>
      <category>neovim</category>
      <category>vim</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I Open-Sourced My Production Git Config (And You Should Steal It)</title>
      <dc:creator>Carlos Orue</dc:creator>
      <pubDate>Tue, 04 Nov 2025 15:21:33 +0000</pubDate>
      <link>https://dev.to/orue/i-open-sourced-my-production-git-config-and-you-should-steal-it-46ja</link>
      <guid>https://dev.to/orue/i-open-sourced-my-production-git-config-and-you-should-steal-it-46ja</guid>
      <description>&lt;p&gt;After years of copying the same git configuration across machines, I finally created the definitive setup.&lt;/p&gt;

&lt;p&gt;Today, I'm sharing it with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Every developer faces this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New machine = hours of git configuration&lt;/li&gt;
&lt;li&gt;Forgetting which settings made things faster&lt;/li&gt;
&lt;li&gt;GPG signing is complicated&lt;/li&gt;
&lt;li&gt;Inconsistent workflows across teams&lt;/li&gt;
&lt;li&gt;Slow git operations on large repos&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;A production-ready git configuration that emphasizes:&lt;/p&gt;

&lt;p&gt;🔐 &lt;strong&gt;Security&lt;/strong&gt; - SSH commit signing, no more GPG complexity&lt;br&gt;
⚡ &lt;strong&gt;Performance&lt;/strong&gt; - 10x faster operations on large repos&lt;br&gt;
🎨 &lt;strong&gt;Developer Experience&lt;/strong&gt; - 25+ useful aliases&lt;br&gt;
📦 &lt;strong&gt;Modern Standards&lt;/strong&gt; - XDG compliance, conventional commits&lt;/p&gt;
&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. SSH Commit Signing Made Simple
&lt;/h3&gt;

&lt;p&gt;SSH signing is way simpler than GPG. You already have SSH keys for GitHub/GitLab authentication. Just use the same key for signing!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No separate keyring to manage&lt;/li&gt;
&lt;li&gt;Works with GitHub and GitLab&lt;/li&gt;
&lt;li&gt;Simple setup (2 minutes)&lt;/li&gt;
&lt;li&gt;"Verified" badge on all commits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Setup:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use your existing SSH key&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; gpg.format ssh
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.signingkey ~/.ssh/id_ed25519.pub
git config &lt;span class="nt"&gt;--global&lt;/span&gt; commit.gpgsign &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Performance That Actually Matters
&lt;/h3&gt;

&lt;p&gt;The configuration includes settings that make git operations significantly faster:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key optimizations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;core.fsmonitor = true&lt;/code&gt; - Use filesystem events (10x faster status)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;core.untrackedCache = true&lt;/code&gt; - Cache untracked files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;core.commitGraph = true&lt;/code&gt; - Faster log operations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;protocol.version = 2&lt;/code&gt; - Modern git protocol&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;index.version = 4&lt;/code&gt; - Compressed index&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real-world impact:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before: &lt;code&gt;git status&lt;/code&gt; takes 3-5 seconds on large repo&lt;/li&gt;
&lt;li&gt;After: &lt;code&gt;git status&lt;/code&gt; takes 0.3 seconds&lt;/li&gt;
&lt;li&gt;That's a 10x improvement!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Aliases That Save Hours
&lt;/h3&gt;

&lt;p&gt;Instead of typing long commands, use shortcuts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git undo        &lt;span class="c"&gt;# Safely undo last commit&lt;/span&gt;
git amend       &lt;span class="c"&gt;# Quick amend without editing message&lt;/span&gt;
git gone        &lt;span class="c"&gt;# Delete local branches that were merged&lt;/span&gt;
git &lt;span class="nb"&gt;sync&lt;/span&gt;        &lt;span class="c"&gt;# Fetch all and pull with rebase&lt;/span&gt;
git recent      &lt;span class="c"&gt;# Show recently worked branches&lt;/span&gt;
git staged      &lt;span class="c"&gt;# Show staged changes&lt;/span&gt;
git unstage     &lt;span class="c"&gt;# Remove from staging&lt;/span&gt;
git wip         &lt;span class="c"&gt;# Quick work-in-progress commit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Time saved:&lt;/strong&gt; ~30 minutes per day&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Security Hardening
&lt;/h3&gt;

&lt;p&gt;Built-in security features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Signed commits&lt;/strong&gt; - Every commit is automatically signed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol blocking&lt;/strong&gt; - No insecure git:// protocol&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Object verification&lt;/strong&gt; - fsckObjects on transfer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secret protection&lt;/strong&gt; - Global ignore for .env, keys, credentials&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Better Diffs and Merges
&lt;/h3&gt;

&lt;p&gt;Enhanced diff algorithm and merge conflict resolution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[diff]&lt;/span&gt;
    &lt;span class="py"&gt;algorithm&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;histogram      # Better than default Myers&lt;/span&gt;
    &lt;span class="py"&gt;colorMoved&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;plain        # Highlight moved code&lt;/span&gt;
    &lt;span class="py"&gt;renames&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true           # Detect renames&lt;/span&gt;

&lt;span class="nn"&gt;[merge]&lt;/span&gt;
    &lt;span class="py"&gt;conflictstyle&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;zdiff3   # Show original + both changes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Easier code reviews and conflict resolution&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Conventional Commits
&lt;/h3&gt;

&lt;p&gt;Built-in commit message template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feat(scope): Add new feature
fix(scope): Fix bug
docs: Update documentation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consistent commit messages&lt;/li&gt;
&lt;li&gt;Automatic changelog generation&lt;/li&gt;
&lt;li&gt;Better team collaboration&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. Cross-Platform Support
&lt;/h3&gt;

&lt;p&gt;Works seamlessly on macOS, Linux, and Windows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic line ending normalization&lt;/li&gt;
&lt;li&gt;Platform-specific gitattributes&lt;/li&gt;
&lt;li&gt;Universal ignore patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;5-minute setup:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Clone the repository&lt;/span&gt;
git clone https://github.com/yourusername/git-configuration.git
&lt;span class="nb"&gt;cd &lt;/span&gt;git-configuration

&lt;span class="c"&gt;# 2. Copy configuration files&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.config/git
&lt;span class="nb"&gt;cp &lt;/span&gt;config ~/.config/git/config
&lt;span class="nb"&gt;cp &lt;/span&gt;commit-template.txt ~/.config/git/commit-template.txt
&lt;span class="nb"&gt;cp &lt;/span&gt;allowed_signers ~/.config/git/allowed_signers
&lt;span class="nb"&gt;cp &lt;/span&gt;attributes ~/.config/git/attributes
&lt;span class="nb"&gt;cp &lt;/span&gt;ignore ~/.config/git/ignore

&lt;span class="c"&gt;# 3. Update with your info&lt;/span&gt;
&lt;span class="c"&gt;# Edit ~/.config/git/config&lt;/span&gt;
&lt;span class="c"&gt;# Replace "Your Name" and "your.email@example.com"&lt;/span&gt;

&lt;span class="c"&gt;# 4. Set up SSH signing (if not already done)&lt;/span&gt;
&lt;span class="c"&gt;# Add your SSH public key to GitHub/GitLab as a signing key&lt;/span&gt;

&lt;span class="c"&gt;# 5. Test it&lt;/span&gt;
git config &lt;span class="nt"&gt;--list&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;After using this configuration:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Setup time: 1+ hour&lt;/td&gt;
&lt;td&gt;Setup time: 5 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Commit signing: Complex GPG&lt;/td&gt;
&lt;td&gt;Commit signing: Simple SSH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git status: Slow&lt;/td&gt;
&lt;td&gt;Git status: 10x faster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Team consistency: Variable&lt;/td&gt;
&lt;td&gt;Team consistency: Standardized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security: Manual&lt;/td&gt;
&lt;td&gt;Security: Automated&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Get It Now
&lt;/h2&gt;

&lt;p&gt;📦 &lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/orue/git-configuration" rel="noopener noreferrer"&gt;git-configuration&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⭐ &lt;strong&gt;Star it if you find it useful!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;The repository includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Complete installation guide&lt;/li&gt;
&lt;li&gt;✅ SSH key generation tutorial&lt;/li&gt;
&lt;li&gt;✅ GitHub/GitLab setup instructions&lt;/li&gt;
&lt;li&gt;✅ Troubleshooting section&lt;/li&gt;
&lt;li&gt;✅ Team workflow recommendations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Your Turn
&lt;/h2&gt;

&lt;p&gt;What git configurations have made your life easier? Share in the comments!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt; #git #productivity #opensource #devtools #tutorial #github #gitlab #ssh #performance #security&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>git</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>2023 Mac Setup for Web Development (Part 01)</title>
      <dc:creator>Carlos Orue</dc:creator>
      <pubDate>Sat, 06 May 2023 23:46:32 +0000</pubDate>
      <link>https://dev.to/orue/2023-mac-setup-for-web-development-part-01-31n4</link>
      <guid>https://dev.to/orue/2023-mac-setup-for-web-development-part-01-31n4</guid>
      <description>&lt;h4&gt;
  
  
  MACBOOK PRO SPECIFICATIONS
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;16-inch&lt;/li&gt;
&lt;li&gt;Apple M1 Max Pro&lt;/li&gt;
&lt;li&gt;16 GB RAM&lt;/li&gt;
&lt;li&gt;1TB SSD&lt;/li&gt;
&lt;li&gt;macOS Ventura&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  TECHNICAL STACK
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Front-End ( JavaScript, React, Vue, Next, Nuxt, Astro)&lt;/li&gt;
&lt;li&gt;Back-End ( Python, NodeJS, GO)&lt;/li&gt;
&lt;li&gt;Database ( PostgreSQL, MongoDB, Redis, Neo4j)&lt;/li&gt;
&lt;li&gt;Cloud ( AWS, Azure, Netlifly, Firebase, Linode, Vercel)&lt;/li&gt;
&lt;li&gt;Other ( Docker, Pulumi, Figma)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  First Step
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Browser: Download Firefox Developer Edition or Chrome, set to default.

&lt;ul&gt;
&lt;li&gt;Login to:&lt;/li&gt;
&lt;li&gt;Github&lt;/li&gt;
&lt;li&gt;Gmail&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Install Rosetta2
&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;softwareupdate &lt;span class="nt"&gt;--install-rosetta&lt;/span&gt; &lt;span class="nt"&gt;--agree-to-license&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install Xcode command-line tools ( alternatively, manually download them from: &lt;a href="https://developer.apple.com/download/all/" rel="noopener noreferrer"&gt;https://developer.apple.com/download/all/&lt;/a&gt;)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcode-select &lt;span class="nt"&gt;--install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After installing Homebrew:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'eval "$(/opt/homebrew/bin/brew shellenv)"'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /Users/user_name/.zprofile
&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;/opt/homebrew/bin/brew shellenv&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Update everything in Homebrew:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  SYSTEM PREFERENCES
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;General

&lt;ul&gt;
&lt;li&gt;Sharing

&lt;ul&gt;
&lt;li&gt;"Change computer name." Local hostname -&amp;gt; Edit&lt;/li&gt;
&lt;li&gt;"Make sure all file sharing is disabled."&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;Notifications

&lt;ul&gt;
&lt;li&gt;Off, except for Calendars and Reminders.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Appearance

&lt;ul&gt;
&lt;li&gt;Show scroll bars -&amp;gt; "Always."&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Desktop Dock

&lt;ul&gt;
&lt;li&gt;Remove most applications from Dock&lt;/li&gt;
&lt;li&gt;Size: Smaller Dock&lt;/li&gt;
&lt;li&gt;Magnification: OFF&lt;/li&gt;
&lt;li&gt;Automatic hide and show the Docke: ON&lt;/li&gt;
&lt;li&gt;Show indicators for open applications: ON&lt;/li&gt;
&lt;li&gt;Show recent applications in Dock: OFF&lt;/li&gt;
&lt;li&gt;Automatically rearrange Space based on most recent use: OFF&lt;/li&gt;
&lt;li&gt;Hot Conners: "disable all"&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Displays

&lt;ul&gt;
&lt;li&gt;Night Shift&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Control Center

&lt;ul&gt;
&lt;li&gt;Battery -&amp;gt; "Show in Menu Bar"&lt;/li&gt;
&lt;li&gt;Battery -&amp;gt; "Show Percentage"&lt;/li&gt;
&lt;li&gt;Menu Bar Only -&amp;gt; Spotlight: "Don't Show in Menu Bar"&lt;/li&gt;
&lt;li&gt;Menu Bar Only -&amp;gt; Siri: "Don't Show in Menu Bar"&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Siri &amp;amp; Spotlight

&lt;ul&gt;
&lt;li&gt;Ask Siri: OFF&lt;/li&gt;
&lt;li&gt;Disable Spotlight (Only if Alfred 5 will be instaled)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Privacy &amp;amp; Scurity

&lt;ul&gt;
&lt;li&gt;Turn on FileVault&lt;/li&gt;
&lt;li&gt;Add Browser to "Screen Recording"&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Keyboard

&lt;ul&gt;
&lt;li&gt; Text Input&lt;/li&gt;
&lt;li&gt; Input Sources -&amp;gt; "Edit"

&lt;ul&gt;
&lt;li&gt; disable "Capitalise word automatically"&lt;/li&gt;
&lt;li&gt; disable "Add period with double-space"&lt;/li&gt;
&lt;li&gt; disable "Use smart quotes and dashes"&lt;/li&gt;
&lt;li&gt; use " for double quotes&lt;/li&gt;
&lt;li&gt; use ' for single quotes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Keyboard Shortcuts&lt;/li&gt;

&lt;li&gt;Spotlight -&amp;gt; "Show Spotlight search": OFF (Only if Alfred 5 will be instaled)&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;Trackpad

&lt;ul&gt;
&lt;li&gt;Tap to Click&lt;/li&gt;
&lt;li&gt;Look up &amp;amp; data detectors: OFF&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Finder
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;General

&lt;ul&gt;
&lt;li&gt;New Finder windows show -&amp;gt; "user name"&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Hide all Tags&lt;/li&gt;

&lt;li&gt;Sidebar

&lt;ul&gt;
&lt;li&gt;activate all Favorites&lt;/li&gt;
&lt;li&gt;move Library to Favorites&lt;/li&gt;
&lt;li&gt;Resent Tags: OFF&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Advanced

&lt;ul&gt;
&lt;li&gt;Show all Filename Extensions: ON&lt;/li&gt;
&lt;li&gt;Remove items from Trash after 30 days: ON&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;### SYSTEM PREFERENCES (TERMINAL)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# take screenshots as jpg (usually smaller size) and not png&lt;/span&gt;
defaults write com.apple.screencapture &lt;span class="nb"&gt;type &lt;/span&gt;jpg

&lt;span class="c"&gt;# do not open previous previewed files (e.g. PDFs) when opening a new one&lt;/span&gt;
defaults write com.apple.Preview ApplePersistenceIgnoreState YES

&lt;span class="c"&gt;# show Library folder&lt;/span&gt;
chflags nohidden ~/Library

&lt;span class="c"&gt;# show hidden files&lt;/span&gt;
defaults write com.apple.finder AppleShowAllFiles YES

&lt;span class="c"&gt;# show path bar&lt;/span&gt;
defaults write com.apple.finder ShowPathbar &lt;span class="nt"&gt;-bool&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# show status bar&lt;/span&gt;
defaults write com.apple.finder ShowStatusBar &lt;span class="nt"&gt;-bool&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# decrease launchpad icons size&lt;/span&gt;
defaults write com.apple.dock springboard-rows &lt;span class="nt"&gt;-int&lt;/span&gt; 7
defaults write com.apple.dock springboard-columns &lt;span class="nt"&gt;-int&lt;/span&gt; 6&lt;span class="p"&gt;;&lt;/span&gt;killall Dock

killall Finder&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Mac setup for web development inspired by &lt;a href="https://www.robinwieruch.de/mac-setup-web-development/" rel="noopener noreferrer"&gt;ROBIN WIERUCH&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>apple</category>
      <category>environment</category>
      <category>webdev</category>
      <category>setup</category>
    </item>
  </channel>
</rss>
