Files
homarr/apps/docs/docs/getting-started/installation/docker.mdx
T

58 lines
1.9 KiB
Plaintext

import { DockerInstallSnippet } from "@site/src/components/pages/installation/docker/dynamic-docker-install";
# Docker
Docker Compose is the recommended installation method. Install
[Docker Engine](https://docs.docker.com/engine/install/) and the
[Compose plugin](https://docs.docker.com/compose/install/).
## Docker Compose
<DockerInstallSnippet data-visual-test="blackout" />
Start Homarr from the directory containing `docker-compose.yaml`:
```sh
docker compose up -d
```
Persist `/appdata`; it contains the database and configuration. Mount the Docker socket only when Homarr needs Docker
discovery or management.
Integration URLs must be reachable from the Homarr container. Browser-facing app URLs may use a different hostname;
see [Managing integrations](/docs/management/integrations#configuration).
### Update
Update the image and recreate the container with the same configuration. Homarr runs database migrations automatically
at startup, including when moving from v1 to v2; no separate upgrade procedure is needed. Keep the `/appdata` mount and
`SECRET_ENCRYPTION_KEY` unchanged. Workshop connects to the production service by default.
```sh
docker compose pull
docker compose up -d
```
### Uninstall
`docker compose down` removes the containers and Compose network. Delete the configured `/appdata` host directory or
volume only when the Homarr data is no longer needed.
## Docker CLI
The equivalent standalone container is:
```sh
docker run \
--name homarr \
--restart unless-stopped \
-p 7575:7575 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /absolute/path/to/homarr/appdata:/appdata \
-e SECRET_ENCRYPTION_KEY='your_64_character_hex_string' \
-d ghcr.io/homarr-labs/homarr:latest
```
Remove the Docker socket mount when it is not required. To update, pull the current image, recreate the container with
the same arguments, and keep the `/appdata` mount and `SECRET_ENCRYPTION_KEY` unchanged.