NoRaincheck

Starting Up Matrix with Docker Compose

Starting Up Matrix with Docker Compose

March 2026

Matrix has a lot of complicated self-hosting docs, mainly to do with federation and hosting. If you’re just self-hosting and not worried about setting up ingresses/federating, its actually fairly simple to setup Matrix. Here is a docker-compose.yml file that will do it. The only bit of configuration is to pull up the element_config.json though that can be left as default values (you can override them later)

 1# Conduit
 2version: "3"
 3
 4services:
 5  homeserver:
 6    image: matrixconduit/matrix-conduit:latest
 7    restart: unless-stopped
 8    ports:
 9      - 8448:6167
10    volumes:
11      - db:/var/lib/matrix-conduit/
12    environment:
13      CONDUIT_SERVER_NAME: changeme # EDIT THIS
14      CONDUIT_DATABASE_PATH: /var/lib/matrix-conduit/
15      CONDUIT_DATABASE_BACKEND: rocksdb
16      CONDUIT_PORT: 6167
17      CONDUIT_MAX_REQUEST_SIZE: 20000000 # in bytes, ~20 MB
18      CONDUIT_ALLOW_REGISTRATION: "true"
19      CONDUIT_ALLOW_FEDERATION: "false"
20      CONDUIT_ALLOW_CHECK_FOR_UPDATES: "false"
21      CONDUIT_TRUSTED_SERVERS: "[]"
22      CONDUIT_ADDRESS: 0.0.0.0
23      CONDUIT_CONFIG: "" # Ignore this
24
25  ### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md
26  element-web:
27    image: vectorim/element-web:latest
28    restart: unless-stopped
29    ports:
30      - 8009:80
31    volumes:
32      - ./element_config.json:/app/config.json
33    depends_on:
34      - homeserver
35
36volumes:
37  db:

To get around the annoying user registration, you may want to manually create it yourself. It would be something like:

1curl -X POST -d '{"username":"john", "password":"smith", "auth": {"type":"m.login.dummy"}}' "http://localhost:8448/_matrix/client/r0/register"
2curl -X POST -d '{"username":"jane", "password":"doe", "auth": {"type":"m.login.dummy"}}' "http://localhost:8448/_matrix/client/r0/register"

<< Previous Post

|

Next Post >>

🎲 Random post

|

All posts

#Self-Hosting #Docker #CLI #Matrix