# Docker

> Run your own app in Docker from a Git repository (Dockerfile or compose file) or a pasted compose file.

Source: https://vantuly.com/docs/apps/sites/docker

A Docker site runs your own containers on your server. It deploys from a **public Git repository**, a **private repository you reach with a team private key**, a **repository you connect through a [GitHub App](/docs/guides/github-app)**, or a **pasted compose file**. Builds always run on the site's own server.

Looking for ready-made apps like n8n or Ghost? Those are on the [Apps page](/docs/apps).

## Requirements

- A server you brought yourself (an install-command server, or a machine created with your own cloud account).
- At least 2 GB of memory and 10 GB of free disk. Vantuly installs Docker the first time a Docker site needs it.
- A site counts its containers' memory limits against the server. Zero-downtime Dockerfile sites count double, because two copies run for a moment during a deploy.

## Create a Docker site

1. Click **New site** and choose **Docker**.
2. On **Details**, pick how to get the code:
   - **Public Git Repository**: paste the repository address and click **Check repository**.
   - **Private Repository (with Deploy Key)**: pick a private key, add it to the repository, paste the SSH address and click **Check repository**. See [Private repositories](/docs/apps/sites/docker/private-repositories).
   - **Git Repository (with GitHub App)**: choose the app and a repository from the list. See [Deploy with a GitHub App](/docs/guides/github-app).
   - **Paste a compose file**: paste it and click **Check**. Problems show next to the line they come from.
3. Set the domain, then create the site. The first deploy starts on finish. For a Git repository the **Server** step comes first, because the repository is checked on the server it will run on.

## Settings

**Settings → Docker** holds the source, Dockerfile path, build context, build target and build arguments, port, health path, zero-downtime and its stop grace period (default 30 seconds), replaced values and the registry for each image host. Saving redeploys.

## Security

- Containers run with `no-new-privileges`, a process limit, and the network capability `NET_RAW` dropped.
- Containers and builds cannot reach the cloud provider's metadata address (`169.254.169.254` and similar).
- Git addresses that resolve to private or internal addresses are refused on the server.
- Public repositories are cloned over HTTPS without credentials and without following redirects.
- A team private key never reaches a place a site can read, and an SSH address that resolves to a private or internal address is refused for it.

Because a Docker site builds and runs code from a repository, only connect repositories you trust.

## Next

- [Public repositories](/docs/apps/sites/docker/public-repositories): deploy from a public Git address, no key. Includes Smart Scan, compose files, deploying, registries and backups.
- [Private repositories](/docs/apps/sites/docker/private-repositories): deploy with a team private key. Includes the same Docker details.
