self_hosting_charm

I want to try and run a selfhosted version of skate. Skate’s backend is run by charm, so this is a quick guide on how to self host skate.

I want to run it on my ubuntu linux box, running ubuntu 22.04.

So i first simply clone the repo and install:

git clone git@github.com:charmbracelet/charm.git
cd charm
sudo apt install golang -y
go install

Now, according to this, simply using charm serve should work.

Using Docker.

Charm keeps up-to-date Docker images at charmcli/charm, so using a docker compose file like this should work:

version: "3.1"
services:
  charm:
    image: charmcli/charm:latest
    container_name: charm
    volumes:
      - /path/to/data:/data
    ports:
      - 35353:35353
      - 35354:35354
      - 35355:35355
      - 35356:35356
    restart: unless-stopped

We want to mount the data directory, to keep it persistent.

No simply docker-compose up -d and charm should be running.

Configuring the charm server.

Charm is configured using a set of environment variables, as described here. These can be passed to docker using a .env file.

   β”‚ File: .env
───────┼───────────────────────────────────────────
   1   β”‚ CHARM_SERVER_HOST=charm.endler.tech
   2   β”‚ CHARM_SERVER_PUBLIC_URL=charm.endler.tech
───────┴───────────────────────────────────────────

Now pass the .env to docker using:

docker-compose --env-file .env up

Setting up skate

Follow this

If you’ve finished setting up your very own Charm Cloud, great. To make skate connect to your self-hosted instance, you’ll need to change the CHARM_HOST environment variable to point to the domain/IP of where you hosted your Charm Cloud.

I just put export CHARM_HOST=db.endler.tech into my .bashrc and skate works great :)