---
title: Install with Docker
project: OpenAuth
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/openauth/1-0/guides/install-docker/
updated: 2026-11-19T09:22:01.648Z
---

# Install with Docker

> Build the OpenAuth image from the repository and run it in a container.

The repository has a `Dockerfile`. You need [Docker](https://docs.docker.com/get-docker/) and Git.

## Build and run

**1.** Get the code and open its folder:

```bash
git clone https://github.com/totaljs/openauth.git
cd openauth
```

**2.** Build the image:

```bash
docker build -t openauth .
```

**3.** Start a container. The volume `openauth` keeps your data when the container is replaced:

```bash
docker run -d --name openauth -p 8000:8000 -v openauth:/www openauth
```

**4.** Open `http://localhost:8000/` and set a primary access token. See [Protect the admin interface](../protect-admin/).

## Stop, start and update

```bash
docker stop openauth
docker start openauth
```

To update, pull the new code, build the image again, remove the old container and start a new one with the same volume:

```bash
git pull
docker build -t openauth .
docker rm -f openauth
docker run -d --name openauth -p 8000:8000 -v openauth:/www openauth
```

Your tokens, provider settings and the sign-in log stay in the volume. Inside the container they are in `/www/.src/databases`. See [The data folder](../../reference/data-folder/).

Sign-ins in progress are kept in memory, so a restart cancels them. Users who were in the middle of signing in start again.
