Skip to main content

Production DevOps: Deploying Modern Web Apps with Docker, Nginx & Ubuntu VPS

DevOps

A practical engineering guide to structuring Docker Compose environments, configuring Nginx reverse proxies with SSL termination, and automating CI/CD deployments on Ubuntu Linux servers.

CODEEN TECHNOLOGIES
August 10, 2026
4 min read

Containerizing Applications with Multi-Stage Docker Builds

Multi-stage Docker builds allow engineering teams to separate compile-time dependencies from runtime environments. By isolating build tools, TypeScript compilers, and dev dependencies in early build stages, the final image contains only production artifacts.

This pattern reduces image footprint, limits the attack surface, and speeds up deployment transfers to production hosts. Running containers as non-root users and mounting secrets through environment variables rather than baking them into layers ensures baseline security hygiene.

Organizing multi-container services with Docker Compose defines predictable networking boundaries between web applications, reverse proxies, and internal databases without exposing unnecessary ports to the public internet.

Nginx Reverse Proxy & SSL Termination

Placing Nginx in front of containerized applications provides a robust ingress layer for SSL termination, request header forwarding, and static asset delivery.

Proper Nginx configuration forwards client IP addresses and protocol headers (such as X-Forwarded-For and X-Forwarded-Proto) accurately to application containers, while configuring gzip or Brotli compression helps optimize response payloads.

Automating SSL certificate provisioning and renewals with Certbot and Let's Encrypt ensures encrypted traffic across all domains. Configuring HTTP to HTTPS 301 redirects and modern TLS protocols secures client-server communication across modern browsers.

Automated Deployment Pipelines with GitHub Actions

Continuous integration pipelines validate code changes before they reach server environments. A typical workflow executes linting, type checks, and unit tests on pull requests before triggering automated deployment steps upon merge.

Using GitHub Actions with secure SSH or deployment runners allows teams to pull fresh container images or synchronize code directly to VPS hosts. Adding execution timeouts and health checks prevents hung deployments from blocking pipeline runners.

Managing deployment credentials exclusively through encrypted repository secrets keeps server access keys and environment variables safe from accidental repository commits.

Process Supervision & Server Monitoring on Ubuntu VPS

On standalone Ubuntu Linux virtual servers, systemd service units and Docker restart policies ensure application containers recover reliably from host reboots or unexpected process terminations.

Configuring the Uncomplicated Firewall (ufw) limits inbound access strictly to SSH, HTTP, and HTTPS ports, preventing unauthorized access to internal database ports.

Setting up log rotation through logrotate prevents Docker container logs and system journals from exhausting server disk space over time. Routine monitoring of CPU, memory, and disk usage helps teams plan server capacity adjustments before resource contention occurs.

#DevOps#Docker#Nginx#Linux#CI/CD#GitHub Actions
Related Engineering Capabilities

Explore CODEEN service offerings related to this architectural guide:

Ready to build a website that sets you apart?

LET'S BUILD TOGETHER

Planning a marketing website or custom web app? We help you scope, build, and launch on time.

Milestones scoped to the project
Clear project scope
Clear Code & IP Terms