BIENVENUE10valid for the first month only! on all offersView plans
Skip to content
← Knowledge base

Deploy an app with Docker

Install Docker, run a container with ports and volumes, then orchestrate with docker-compose.

Deploy an app with Docker

Docker isolates your application and its dependencies in a reproducible container. You run an image, map ports and volumes, and you are done.

Cause / The problem

“It works on my machine” is the classic problem: a different runtime version, a missing system dependency, a port already taken. Docker removes these gaps by packaging the app with its environment.

Solution

  1. Install Docker on your instance:
    curl -fsSL https://get.docker.com | sh
    sudo usermod -aG docker $USER   # then log out and back in
  2. Run an existing image:
    docker run -d --name my-app -p 8080:8080 -e PORT=8080 my-image:latest
    • -d: detached, --name: container name.
    • -p host:container: map a port, -e KEY=value: an env var.
    • -v /host/path:/container/path: a persistent volume.
  3. Check the status:
    docker ps                  # running containers
    docker logs -f my-app      # live logs
  4. Build your own image with a Dockerfile, then:
    docker build -t my-app .
    docker run -d -p 8080:8080 my-app
  5. Use docker-compose to manage several services. docker-compose.yml:
    services:
      app:
        image: my-app:latest
        ports: ["8080:8080"]
        environment:
          PORT: "8080"
        volumes: ["./data:/app/data"]
        restart: unless-stopped
    Then docker compose up -d.
  6. Pick a restart policy: restart: unless-stopped or restart: always to survive a reboot.
  7. Update:
    docker compose pull && docker compose up -d

Common errors: bind: address already in use (a port is taken — change the host port), permission denied (add your user to the docker group or use sudo).

oneSubnet

French hosting provider in Paris. High-performance game and voice servers.

SERVICES

Resources

LEGAL

All systems operational