惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
月光博客
月光博客
量子位
大猫的无限游戏
大猫的无限游戏
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
P
Proofpoint News Feed
B
Blog RSS Feed
美团技术团队
腾讯CDC
C
Check Point Blog
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
J
Java Code Geeks
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How to Deploy a Docker App to Any VPS in Under 10 Minutes
Abdullah Sheikh · 2026-05-30 · via DEV Community

Abdullah Sheikh

Deploy your containerized app to a fresh VPS from zero to live in less than ten minutes

Before We Start: What You'll Walk Away With

By the end of this guide you’ll have a live Docker container humming on a brand‑new VPS, ready to serve traffic.

One command will spin up the whole stack, so you can treat deployment like ordering a pizza: you pick the toppings, hit “place order,” and the kitchen does the rest.

All the tools you’ll touch are free or have a generous freemium tier, meaning you can start without spending a dime.

  • Connect to a fresh VPS and install Docker in seconds.

  • Push your app’s image to a public registry.

  • Run a one‑line script that pulls the image, creates a container, and sets up a basic firewall.

  • Quick start: curl -sSL https://example.com/deploy.sh | bash

  • Rollback ready: The script saves the previous container ID, so you can revert with a single command.

  • Zero‑config networking: Uses the VPS’s default interface, no manual port forwarding needed.

This approach lets you skip the usual “install Docker, configure systemd, tweak iptables” maze and get straight to running code, just like using Google Maps to bypass traffic snarls.

When you finish, deploying a Docker app to VPS will feel as routine as packing a suitcase for a weekend trip—pick, zip, go.

What Deploying a Docker App Actually Is (No Jargon)

Deploying a Docker app means taking the container image you built on your laptop and copying it to a remote server so it runs there nonstop. The server pulls the image, starts a container, and keeps it alive until you decide to stop it.

Think of it like sending a pre‑packed lunch to a coworker’s desk. You’ve already prepared the sandwich, fruit, and napkin (the container). You drop the lunchbox at the office kitchen (the VPS), and a timer makes sure the food stays warm all day. No one has to re‑make the sandwich on site, and the lunch stays ready whenever it’s needed.

  • Copy the image with docker push or scp – like handing the lunchbox to the mailroom.

  • Start the container with docker run -d – like placing the lunch on a heated plate.

  • Monitor it with docker ps – like checking that the timer is still ticking.

When you deploy Docker app to VPS you’re basically automating that hand‑off so the app is up and running the moment the server boots, without manual re‑assembly.

The 3 Mistakes Everyone Makes With Docker VPS Deployments

Most of the time you spend fixing the same things over and over, and it slows you down.

  • Installing Docker manually on every new server – think of it like ordering a pizza for each friend individually instead of using the party‑size menu. You repeat the same steps, risk a typo, and waste precious minutes. Automate the install with a single script or a cloud‑init snippet, and you’ll get a clean, identical Docker engine on every VPS instantly.

  • Forgetting to open the right ports – it’s the digital equivalent of locking the front door while leaving the back window open. Your container runs, but the world can’t reach it. Make a habit of adding ufw allow 80/tcp or the specific port your app uses right after the Docker install, then verify with curl http://your‑vps-ip:PORT.

  • Running the container without a process manager – imagine packing a suitcase without tying the straps; the contents tumble out at the first bump. Without something like systemd or Docker’s built‑in restart policy, a reboot sends your app back to sleep. Use --restart unless-stopped in docker run or create a simple service file so the container boots up automatically.

Fix these three, and you’ll stop chasing ghosts when you deploy Docker app to VPS.

How to Deploy a Docker App: Step-by-Step

Grab a fresh Ubuntu 22.04 VPS and get it ready in five moves.

  • Pick a provider and launch the server. Think of it like ordering a pizza – you choose the crust (provider) and size (Ubuntu 22.04), then wait for delivery (instance).

  • SSH in and install Docker + firewall. Run a single command that does the heavy lifting.

ssh root@your-vps-ip
sudo apt-get update && sudo apt-get install -y ca-certificates curl gnupg
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
sudo ufw allow OpenSSH
sudo ufw allow 2375/tcp
sudo ufw --force enable

  • Pull your image. This is like grabbing a ready‑made sandwich from the fridge.
docker pull yourusername/yourapp:latest

  • Create a systemd service. The service is the “alarm clock” that wakes your container on boot.
sudo tee /etc/systemd/system/yourapp.service > /dev/null  /dev/null **UFW (Uncomplicated Firewall)** – Ubuntu’s built‑in guardrail works like a simple gate with three keys. One liner to open the necessary ports: 


bash
ufw allow 22 && ufw allow 80 && ufw allow 443 && ufw enable


- **GitHub Actions** – Automate the build pipeline the way a coffee machine brews on schedule. A workflow file builds your Docker image on every push and pushes it to Docker Hub, so the VPS always pulls the latest tag.

With these tools in your toolbox, **deploy Docker app to VPS** becomes a repeatable, low‑effort routine.

## Quick Reference: Docker App Deployment Cheat Sheet

Grab a coffee and copy‑paste this list to get your Docker app running on any VPS in under ten minutes.

- **Prep** – Pick a VPS, write down its IP, and make sure your Docker image is pushed to a registry. Think of it like writing down an address before ordering a pizza.

**Install** – Run the one‑liner that drops Docker on the box and opens the needed ports:


bash
curl -fsSL https://get.docker.com | sh && ufw allow 22 && ufw allow 80 && ufw enable


**Pull Image** – Grab the image you built earlier:


bash
docker pull yourrepo/yourapp:tag


- **Service File** – Create `/etc/systemd/system/yourapp.service` with an `ExecStart` that runs the container. It’s the same as setting a “Start when I turn the key” rule for a car.

**Enable** – Start the service and let it survive reboots. For example, *Alex* a solo founder, runs:


bash
systemctl enable --now yourapp


**Verify** – Confirm the container is alive and reachable:


bash
docker ps
curl http://YOUR_IP:PORT


- **Tip** – Keep the service file minimal; only expose the ports you need.

- **Tip** – Use `--restart unless-stopped` in the `ExecStart` line to auto‑recover from crashes.

- **Tip** – If you change the image tag, just repeat steps 2–5; systemd will pick up the new container.

Copy, paste, and you’re live – that’s all it takes to *deploy Docker app to VPS*.

## What to Do Next

Kick the tires on your new setup by running a tiny “hello‑world” container and seeing it survive a reboot.

**Easy** – SSH into the VPS, pull `nginx:alpine`, and start it in detached mode:


bash
docker run -d --name hello -p 80:80 nginx:alpine


Then reboot the server (`sudo reboot`) and check `docker ps`. If the container is still running, you’ve proven the deployment works—just like ordering a coffee, getting it, and watching it stay hot.
**Medium** – Wire a CI pipeline so every push builds a fresh image and pushes it to your registry. In GitHub Actions add a job that runs on `push` to `main`:


yaml
name: Build & Deploy
on:
push:
branches: [main]
jobs:
docker:
runs-on: ubuntu-latest
steps:

  • uses: actions/checkout@v3
  • name: Log in to Docker Hub run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USER" --password-stdin
  • name: Build and push run: | docker build -t $DOCKER_USER/myapp:${{ github.sha }} . docker push $DOCKER_USER/myapp:${{ github.sha }}

Now each merge automatically refreshes the image—think of it as a kitchen that restocks ingredients every time a new order comes in.
**Hard** – Let infrastructure-as-code handle the whole stack. With Pulumi (TypeScript) you can spin up a VPS, open ports, install Docker, and deploy the container in one file:


ts
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const droplet = new digitalocean.Droplet("app", {
region: "nyc3",
size: "s-1vcpu-1gb",
image: "ubuntu-22-04-x64",
userData: #!/bin/bash
apt-get update && apt-get install -y docker.io
docker run -d --restart unless-stopped -p 80:80 myrepo/myapp:latest
,
});

export const ip = droplet.ipv4Address;




Running `pulumi up` provisions everything, like using Google Maps to draw the entire road trip before you leave the house.

- **Cheat sheet**: keep `docker-compose.yml` ready for local testing; copy it to the VPS with `scp` when you need a quick redeploy.

- **Tip**: enable `--restart unless-stopped` on every container so reboots never drop your services.

Got a different stack or cloud provider? Drop a comment and let us know what tweaks you needed!

---

---

## About the Author

**[Abdullah Sheikh](https://abdullah-sheikh.com/)** is the Founder & CEO at [Exteed](https://exteed.com/), where he leads a team of skilled developers specializing in [Web2](https://abdullah-sheikh.com/) and [Web3 applications](https://abdullah-sheikh.com/), [Custom Smart Contracts](https://abdullah-sheikh.com/), and [Blockchain solutions](https://abdullah-sheikh.com/).

With 6+ years of experience, Abdullah has built [CRMs](https://abdullah-sheikh.com/), [Crypto Wallets](https://abdullah-sheikh.com/), [DeFi Exchanges](https://abdullah-sheikh.com/), [E-Commerce Stores](https://abdullah-sheikh.com/), [HIPAA Compliant EMR Systems](https://abdullah-sheikh.com/), and [AI-powered systems](https://abdullah-sheikh.com/) that drive business efficiency and innovation.

His expertise spans [Blockchain](https://abdullah-sheikh.com/), [Crypto & Tokenomics](https://abdullah-sheikh.com/), [Artificial Intelligence](https://abdullah-sheikh.com/), and [Web Applications](https://abdullah-sheikh.com/); building reliable and smooth web apps that fit the client’s goals and requirements.

📧 [info@abdullah-sheikh.com](mailto:info@abdullah-sheikh.com) · 🔗 [LinkedIn](https://www.linkedin.com/in/-abdullah-sheikh/) · 🌐 [abdullah-sheikh.com](https://abdullah-sheikh.com/)