mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-21 06:54:25 +00:00
545e2665f3
# Which Problems Are Solved - Docs code blocks that display imported files (YAML configs, Go examples) render as unstyled plain text with no syntax highlighting, unlike fenced code blocks which go through `rehypeCode`/Shiki # How the Problems Are Solved - Deleted `components/docusaurus/code-block.tsx` entirely — no custom wrapper is needed anymore - Replaced all usages with `DynamicCodeBlock` from `fumadocs-ui/components/dynamic-codeblock` directly in MDX files; it handles SSR pre-rendering through the same Shiki pipeline as all other code blocks - Raw file content (YAML, Go) is imported as strings via webpack's existing `asset/source` rule already configured in `next.config.mjs` — no new infrastructure required - In `_proxy_guide_tls_mode.mdx`, the `Commands` JSX component was refactored from concatenated JSX array children to a single template literal string, which is what `DynamicCodeBlock` (and any string-based highlighter) requires - All changes applied to both non-versioned docs and versioned snapshots (v4.10, v4.11) # Additional Changes None. # Additional Context - Affected MDX files: YAML config files under `self-hosting/manage/configure/`, reverse-proxy guides, `self-hosting/deploy/compose.mdx`, and the actions `testing-request-signature.mdx` guide <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>code block style is weird</issue_title> > <issue_description>### Preflight Checklist > > - [x] I could not find a solution in the existing issues, docs, nor discussions > - [x] I have joined the [ZITADEL chat](https://zitadel.com/chat) > > ### Describe the docs your are missing or that are wrong > > This hurts my eyes: > > <img width="867" height="525" alt="Image" src="https://github.com/user-attachments/assets/b7b66d92-56e1-4e0a-8dba-3cab448930fe" /> > > ### Additional Context > > _No response_</issue_description> > > <agent_instructions>the user reported a weirdly styled code block in the docs page where we used to display yaml files. Investigate the docs and fix the styling</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > <comment_new><author>@fforootd</author><body> > haha, ok that is certainly weird, let me look at that.</body></comment_new> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes zitadel/zitadel#11645 <!-- START COPILOT CODING AGENT TIPS --> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: fforootd <[email protected]> Co-authored-by: Florian Forster <[email protected]>
90 lines
4.2 KiB
Plaintext
90 lines
4.2 KiB
Plaintext
---
|
|
title: Set up Zitadel with Docker Compose
|
|
sidebar_label: Docker Compose
|
|
---
|
|
|
|
import NoteInstanceNotFound from './troubleshooting/_note_instance_not_found.mdx';
|
|
import DockerCompose from './docker-compose.yaml';
|
|
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
|
|
|
|
import Disclaimer from './_disclaimer.mdx'
|
|
import DefaultUser from './_defaultuser.mdx'
|
|
import Next from './_next.mdx'
|
|
|
|
This guide is the entrypoint for running the Zitadel platform locally for the first time.
|
|
It is for demonstration and development purposes only and does not set up a production-ready and security hardened instance of Zitadel.
|
|
Once Zitadel up is and running, learn more about a production setup in the [What's Next section](#next-steps).
|
|
|
|
## Prerequisites
|
|
|
|
The setup is likely to work with other software versions too, but it is tested against the following environment:
|
|
|
|
- Ubuntu 24.04.1
|
|
- Docker 28.3.2
|
|
- Docker Compose v2.38.2
|
|
- curl 8.5.0
|
|
|
|
## Docker compose
|
|
|
|
The following commands set up services for a PostgreSQL database, a Zitadel API and a Zitadel login:
|
|
|
|
1. Download the `docker-compose.yaml` file from the Zitadel repository:
|
|
```shell
|
|
curl -L https://raw.githubusercontent.com/zitadel/zitadel/main/apps/docs/content/self-hosting/deploy/docker-compose.yaml -o docker-compose.yaml
|
|
```
|
|
2. Make sure the containers use the latest image versions.
|
|
```shell
|
|
docker compose pull
|
|
```
|
|
3. Run the PostgreSQL database, the Zitadel API, and the Zitadel login.
|
|
```shell
|
|
docker compose up --detach --wait
|
|
```
|
|
4. Verify the containers are running and healthy.
|
|
```shell
|
|
docker compose ps
|
|
```
|
|
|
|
<DefaultUser components={props.components} />
|
|
|
|
## What's next
|
|
|
|
Before proceeding, review the downloaded `docker-compose.yaml` file:
|
|
The comments give context to the used variables and show examples for commonly used configuration variants.
|
|
|
|
<details>
|
|
<summary>docker-compose.yaml</summary>
|
|
<DynamicCodeBlock lang="yaml" code={DockerCompose} />
|
|
</details>
|
|
|
|
Here are some natural steps forward to go from the current setup to production:
|
|
|
|
- **Use a different master key**: Set up an instance from scratch and use a different master key. For example, generate one by running `tr -dc A-Za-z0-9 </dev/urandom | head -c 32`
|
|
- **Use files for secrets instead of environment variables, and don't commit them to Git**: Learn how to [configure the platform](/self-hosting/manage/configure)
|
|
- **Run the containers as non-root users**: Remove the `user: "0"` lines from the `docker-compose.yaml` file.
|
|
- **Configure a different external domain or IP**: Beware that the login only works with HTTPS on non-localhost domains. [Run and configure a reverse proxy](/self-hosting/manage/reverseproxy/reverse_proxy)
|
|
- **Serve the API and the UI together on the same port**: [Run and configure a reverse proxy](/self-hosting/manage/reverseproxy/reverse_proxy)
|
|
- **Encrypt Traffic**: [Run and configure a reverse proxy](/self-hosting/manage/reverseproxy/reverse_proxy)
|
|
|
|
For more detailed recommendations, read the [Zitadel Production Setup Guide](/self-hosting/manage/production).
|
|
|
|
<details>
|
|
<summary>Read this if the environment uses the login v1</summary>
|
|
<p>
|
|
The login v2 is the next generation of the Zitadel login.
|
|
Its code and deployment are easily customizable.
|
|
Unlike the login v1, it runs in its own process.
|
|
The login v2 is enabled by default in new installations.
|
|
But if an existing `docker-compose.yaml` file is updated by following this guide,
|
|
an additional `zitadel-login` service is now running which is actually not doing anything, yet.
|
|
The following steps give guidance on how to enable the login v2 in an environment.
|
|
</p>
|
|
<ol>
|
|
<li>Read the login v2 related comments in the docker-compose.yaml.</li>
|
|
<li><a href="../../self-hosting/manage/login-client#create-login-client">Manually create a login client personal access token (PAT) for the now running v2 login</a>.</li>
|
|
<li>Move the PAT to `./login-client.pat`</li>
|
|
<li>Restart the login process: `docker compose restart login`</li>
|
|
<li><a href="../../self-hosting/manage/login-client#require-login-v2">Enable the Login UI for all users</a></li>
|
|
</ol>
|
|
</details>
|