Skip to content

Setting up Continuwuity

To simplify deployment for this guide, I'm going to use Docker to run Continuwuity. In production, I don't actually do this, I use the native binary. In fact, I go as far as to compile it myself from source for marginally better performance. However, for the sake of simplicity, I'm going to use Docker here.

Preparing the environment

Danger

If you are using a VPS to bypass NAT/firewall, you do not do this on the VPS. You should do this on your home server.

If you don't have Docker installed, run the convenience script: curl -fsSLo- https://get.docker.com | sh.

You will want to create a directory for your docker compose to live in, first off.

mkdir -p ~/continuwuity
# Then, cd into it
cd ~/continuwuity

Now you'll want to create your docker-compose.yml file. I recommend the below template as a good starting point, but there's a few of them on the official documentation site.

# this assumes docker compose that supports v3 or higher
services:
  continuwuity:
    image: forgejo.ellis.link/continuwuation/continuwuity:latest
    # If you want bleeding edge functionality, and are able to keep up with updates,
    # use the `:main` tag instead:
    # image: forgejo.ellis.link/continuwuation/continuwuity:main
    container_name: continuwuity
    restart: unless-stopped
    ports:
      - "6167:127.0.0.1:6167"  # remove 127.0.0.1 if you need to bypass the reverse proxy externally.
    volumes:
      - /etc/resolv.conf:/etc/resolv.conf:ro  # this is required to avoid DNS performance issues
      - ./config.toml:/etc/conduwuit.toml:ro
      - ./data:/var/lib/conduwuit:rw  # this is where the database and media files are stored.
      # If you want your media files to be stored on a different volume, you can instead map that like so:
      # - ./media:/var/lib/conduwuit/media:rw
      # It is recommended that the database be kept on an SSD, ideally an NVMe
      # It doesn't matter where media is stored, but the database needs to be fast. HDDs work but are suboptimal.
    environment:
      CONDUWUIT_CONFIG: '/etc/conduwuit.toml'  # tells continuwuity where the config file is

Listen address

If you have Caddy running on a different server, you will need to replace 6167:127.0.0.1:6167 with 6167:6167. This will make Docker bind to all interfaces, meaning that your external Caddy server can connect to it. If you keep it as 127.0.0.1, Caddy can only connect to it if Caddy is running on the same server.

Now, you'll need to edit the config file. Grab the latest one from the repo, and open it in your editor of choice:

# This will grab the latest config file from the repo, from the main branch.
# If you are running the latest tag, or a specific release, you should change
# the branch name to the release you are using.
# For example,
# https://forgejo.ellis.link/continuwuation/continuwuity/src/tag/v0.5.0-rc.5/conduwuit-example.toml
curl -fsSLo ./config.toml https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/conduwuit-example.toml
$EDITOR ./config.toml

Here's the things you NEED to change:

  • server_name: This is the server name I talked about earlier. This is the bit after the : in your user ID (e.g. @user:example.com). This must be the same as the domain you registered, and the one you set up in your DNS records. If you want to use a subdomain, set this to the subdomain you want to use. YOU CANNOT CHANGE THIS AFTER YOU SET IT UP! This is also NOT your matrix subdomain, if you set that up.
  • database_path: Set this to "/var/lib/conduwuit" (or wherever you mounted the database volume to).
  • address: Set this to "0.0.0.0"
  • ip_lookup_strategy: If you don't have IPv4, set this to 1. If you don't have IPv4, set this to 2. If you have both, just leave it as-is.

The rest of the config can typically be left as-is, as a lot of the default values scale based on the available resources on the server.

You will also want to change trusted_servers to include a list of servers that are not matrix.org, however, they can only be Synapse servers for now. You should only set servers that you trust, but are also reliable and fast. I typically use beeper.com, envs.net, tchncs.de, and have matrix.org as a fallback.

trusted_servers = [
    "beeper.com",
    "envs.net",
    "tchncs.de",
    "matrix.org",
]

Having slow notary (trusted) servers can cause room joins to be slow, so it is recommended (but not required) to have a few of them in your config.

Creating your first user

Your first user is created by temporarily starting the server, and running the users create admin command. You only need to do this once.

To do this, run the following command:

docker compose run --rm continuwuity --execute 'users create <your username here> [optional password]' --execute 'server shutdown'

This will create a user with the username you specified, and a password if you provided one. If you didn't provide a password, you will have to pick it out of the logs generated by the server.

The first user created will be the admin user, and will have full access to the server. You can then log in to the server using the username you specified, and the password you provided (or the one you picked out of the logs).

I lost the password to the admin/all of my admin accounts!

If you lose the password to your admin account, you can reset it by running the following command:

docker compose run --rm continuwuity --execute 'users reset-password <your username here>'

This will generate a new password for the user, and print it to the logs. You can then log in with the new password. You cannot run that command while the server is running, so you will need to stop the server first.

Almost ready! Now you just need to finish setting up Caddy, and then you're good to go!