> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.lumiweb.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker

> Installing Docker and running containers

Docker runs programs in isolated "boxes" (containers): inside the box sits the program itself and everything it needs. You don't have to install libraries by hand and match up versions — grab a ready-made image, run it, and it works. Delete the container and your system stays clean. Instead of a dozen commands from a how-to, it's usually one or two, and the service is already running.

On a Lumi server you're root by default (the IP and password are on the server card in the bot), and the default image is Ubuntu 22.04, so the official script below installs with no extra steps.

<Note>
  Commands are current as of writing. Before installing, check the official site [docs.docker.com](https://docs.docker.com/engine/install/) — the syntax changes from time to time.
</Note>

## Installation

<Steps>
  <Step title="Download the official script">
    The fastest way is the official script. It detects your system (Ubuntu or Debian) on its own and installs the latest Docker:

    ```bash theme={"system"}
    curl -fsSL https://get.docker.com -o get-docker.sh
    ```
  </Step>

  <Step title="Run the script">
    ```bash theme={"system"}
    sh get-docker.sh
    ```

    <Tip>
      If you want more control over the process, install Docker from the official repository. It's a longer route, but it gives you precise control over where the packages come from. Full instructions for Ubuntu and Debian are on [docs.docker.com](https://docs.docker.com/engine/install/).
    </Tip>
  </Step>

  <Step title="Check that everything works">
    ```bash theme={"system"}
    docker run hello-world
    ```

    Docker downloads a tiny test image and runs it. If you see the message `Hello from Docker!`, the installation went through.
  </Step>
</Steps>

## Basic commands

<AccordionGroup>
  <Accordion title="Run a container">
    Run a container in the background with port mapping (external port `8080` → port `80` inside the container):

    ```bash theme={"system"}
    docker run -d -p 8080:80 nginx
    ```

    Here `-d` is detached (background) mode, `-p` is the port mapping, and `nginx` is the image name.
  </Accordion>

  <Accordion title="List running containers">
    ```bash theme={"system"}
    docker ps
    ```
  </Accordion>

  <Accordion title="View a container's logs">
    By name or ID from `docker ps`:

    ```bash theme={"system"}
    docker logs CONTAINER_NAME
    ```
  </Accordion>

  <Accordion title="Stop and remove a container">
    ```bash theme={"system"}
    docker stop CONTAINER_NAME
    docker rm CONTAINER_NAME
    ```
  </Accordion>

  <Accordion title="List downloaded images">
    ```bash theme={"system"}
    docker images
    ```
  </Accordion>
</AccordionGroup>

## Docker Compose

When a service needs several containers (an app + a database, for example) or just a long startup command with a pile of parameters that's awkward to keep in your head, Docker Compose lets you describe it all in a single `compose.yaml` file and bring it up with one command.

<Note>
  In the current version, Docker Compose is built into Docker as a plugin and is invoked via `docker compose` (no hyphen). The old standalone `docker-compose` utility (with a hyphen) is deprecated — it's not present in new installations.
</Note>

Example `compose.yaml` — a web server on port 8080:

```yaml theme={"system"}
services:
  web:
    image: nginx
    ports:
      - "8080:80"
    restart: unless-stopped
```

Put the file in its own folder, change into it, and bring the service up in the background:

```bash theme={"system"}
docker compose up -d
```

Stop and remove everything described in the file:

```bash theme={"system"}
docker compose down
```

<Warning>
  If a container maps a port to the outside (the `-p` flag or a `ports` block), that port becomes reachable from the internet. Open only the ports you actually need in the firewall, and password-protect any control panels. Firewall setup: [Firewall (ufw)](/en/vps/firewall).
</Warning>

Lumi handles the server and network; software setup is on you. Network or port issues — [@lumisup\_robot](https://t.me/lumisup_robot).

## Where to next

<CardGroup cols={2}>
  <Card title="n8n" icon="diagram-project" href="/en/vps/n8n">
    No-code process automation — runs via Docker.
  </Card>

  <Card title="Your own LLM" icon="robot" href="/en/vps/llm">
    A neural net on your server via Ollama.
  </Card>
</CardGroup>
