2021-06-01 09:55:08 +02:00
# Quickstart with docker compose
2021-12-31 18:04:20 +01:00
## Prerequisites
The only prerequisite you need fullfill, is that you need to have docker installed with support for compose and buildkit. The resource limit must at least be:
* CPU's: 2
* Memory: 4Gb
## Start ZITADEL
2021-06-01 09:55:08 +02:00
You can start ZITADEL with a simple docker compose up.
The services are configured to restart if an error occurs.
In the following script the basic setup of the database is executed before ZITADEL starts. Execute the statement from the root of ZITADEL.
2021-12-31 18:04:20 +01:00
You can connect to [ZITADEL on localhost:4200 ](http://localhost:4200 ) after the frontend compiled successfully. Initially it takes several minutes to start all containers.
2021-06-01 09:55:08 +02:00
```bash
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 \
2021-12-31 18:04:20 +01:00
& & docker compose -f ./build/local/docker-compose-local.yml --profile backend --profile frontend up
2021-06-01 09:55:08 +02:00
```
For a more detailed guide take a look at the [development guide ](./development.md )
2021-07-27 21:55:30 +02:00
## FAQ
2021-12-31 18:04:20 +01:00
### Mac M1 (Apple Silicon)
2021-07-27 21:55:30 +02:00
2021-12-31 18:04:20 +01:00
Bellow are some errors we faced with apple silicon.
2021-07-27 21:55:30 +02:00
2021-12-31 18:04:20 +01:00
#### database-migrations don't start or stop without exit code
You can simply restart the database with the following command:
```bash
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 \
& & docker compose -f ./build/local/docker-compose-local.yml restart db
```
2021-07-27 21:55:30 +02:00
2021-12-31 18:04:20 +01:00
#### API call's block and don't return any response
2021-07-27 21:55:30 +02:00
2021-12-31 18:04:20 +01:00
The problem is that the database has a connection issues. You can simply restart the database with the following command:
2021-07-27 21:55:30 +02:00
2021-12-31 18:04:20 +01:00
```bash
2021-07-27 21:55:30 +02:00
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 \
2021-12-31 18:04:20 +01:00
& & docker compose -f ./build/local/docker-compose-local.yml restart db
2021-07-27 21:55:30 +02:00
```
2021-12-31 18:04:20 +01:00
### Build Errors
If you experience strange docker error you might need to check that `buildkit` is enabled.
Make sure to enable `"features": { "buildkit": true }` in your docker settings!
2021-07-27 21:55:30 +02:00
### Remove the quickstart
```Bash
2021-12-31 18:04:20 +01:00
docker-compose -f ./build/local/docker-compose-local.yml --profile database --profile init-backend --profile init-frontend --profile backend --profile frontend rm
2021-07-27 21:55:30 +02:00
```
If you are **confident** that you don't need to run the same ZITADEL instance again, go ahead and delete the `.keys` folder and reset the `environment.json` as well.
```Bash
rm -rf .keys
```
```Bash
git reset build/local/environment.json
```