# Install ZITADEL on MacOS

## Install PostgreSQL

Download a `postgresql` binary as described [in the PostgreSQL docs](https://www.postgresql.org/download/macosx/).
ZITADEL is tested against PostgreSQL latest stable tag and latest Ubuntu LTS.

## Run PostgreSQL

```
sudo pg_ctl init -D /tmp/postgresql
sudo pg_ctl start -D /tmp/postgresql
```

## Install ZITADEL

### Homebrew

```
brew install zitadel/tap/zitadel
```

### Download from GitHub

Download the ZITADEL release according to your architecture from [Github](https://github.com/zitadel/zitadel/releases/latest)

## Unpack the archive

move to your download location and unpack the archive

```
#unpack and copy to /usr/local/bin
LATEST=$(curl -i https://github.com/zitadel/zitadel/releases/latest | grep location: | cut -d '/' -f 8 | tr -d '\r'); wget -qO-  https://github.com/zitadel/zitadel/releases/download/$LATEST/zitadel_Darwin_$(uname -m).tar.gz  | tar -xJ zitadel && sudo mv zitadel /usr/local/bin
```

## Run ZITADEL

```
ZITADEL_DATABASE_POSTGRES_DSN="postgresql://root:postgres@localhost:5432/postgres?sslmode=disable" ZITADEL_EXTERNALSECURE=false zitadel start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --tlsMode disabled
```

Visit [http://localhost:8080/ui/console?login_hint=zitadel-admin@zitadel.localhost](http://localhost:8080/ui/console?login_hint=zitadel-admin@zitadel.localhost) and enter `Password1!` to log in.

This guide is based on a local setup.
If you encounter an error "Instance Not Found" please read the following section:
[Instance not found](/content/docs/self-hosting/deploy/troubleshooting/troubleshooting#instance-not-found/index.html)

## VideoGuide

Mac installation - YouTube

[Mac installation](https://www.youtube.com/watch?v=Ob-kBzmezeg) [ZITADEL](https://www.youtube.com/channel/UCUAWJUNYaRn1yIVrZxEfsuA)

### Setup ZITADEL with a service account

```
ZITADEL_DATABASE_POSTGRES_DSN="postgresql://root:postgres@localhost:5432/postgres?sslmode=disable" ZITADEL_EXTERNALSECURE=false ZITADEL_FIRSTINSTANCE_MACHINEKEYPATH=/tmp/zitadel-admin-sa.json ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINE_USERNAME=zitadel-admin-sa ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINE_NAME=Admin ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINEKEY_TYPE=1 zitadel start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --tlsMode disabled

# then you can move your machine key
mv /tmp/zitadel-admin-sa.json $HOME/zitadel-admin-sa.json
```

This key can be used to provision resources with for example [Terraform](/content/docs/guides/manage/terraform-provider/index.html).

## What's next

For running a production grade ZITADEL instance in your environment, go on with the [configure ZITADEL](/content/docs/self-hosting/manage/configure/index.html) section.

The ZITADEL management console [requires end-to-end HTTP/2 support](/content/docs/self-hosting/manage/http2/index.html)

## Disclaimer

This guide is for development / demonstration purpose only and does NOT reflect a production setup.

Things such as TLS termination and email verification will not be available unless you

- Use an API gateway with valid certificates in front of the service
- Configure an appropriate email server
