Skip to content

01. Install

Naoki Kosaka edited this page Jun 29, 2025 · 7 revisions

Install Activity-Relay

Docker Compose

Requirements

  • git
  • openssl
  • docker
  • docker-compose
  1. Clone the repository

    $ git clone https://github.com/yukimochi/Activity-Relay.git -b v2.0.9

    Note: Check the latest version for yourself here

  2. Copy and write config.yml

    The config.yml format should follow this

    $ cp config.yml.example config.yml
    $ vim config.yml
  3. Generate an actor RSA certificate to ./actor.pem

    $ openssl genrsa -traditional | tee actor.pem
    $ chmod 600 actor.pem

    Note: If you use OpenSSL version <3, type openssl genrsa instead of openssl genrsa -traditional

  4. Build the image and run services

    $ docker compose build
    $ docker compose up -d

    Verify that it is running

    $ docker compose ps

    Stop services

    $ docker compose down

Linux service

Requirements

  • openssl
  • relay binary that you build from source
  • systemctl --version 232 or newer
  • sudo privileges
  1. Move the relay binary into your $PATH

    $ sudo mv relay /usr/bin
  2. Test that it worked

    $ relay    
  3. Create a group named relay

    $ sudo groupadd --system relay
  4. Create a user named relay, with a writeable home folder

    $ sudo useradd --system \
    --gid relay \
    --create-home \
    --home-dir /var/lib/relay \
    --shell /usr/sbin/nologin \
    --comment "YUKIMOCHI Activity-Relay" \
    relay
  5. Place config.yml in /var/lib/relay/config.yml

    The config.yml format should follow this

    $ sudo mv config.yml /var/lib/relay
  6. Generate an actor RSA certificate in /var/lib/relay/actor.pem

    $ openssl genrsa -traditional | sudo tee /var/lib/relay/actor.pem
    $ sudo chmod 600 /var/lib/relay/actor.pem
    $ sudo chown relay:relay /var/lib/relay/actor.pem

    Note: If you use OpenSSL version <3, type openssl genrsa instead of openssl genrsa -traditional

  7. Place systemd service files and start services

    Download the systemd service files from here and check the ExecStart directive. Make sure the binary's location is correct for your installation.

    $ sudo mv relay-api.service /etc/systemd/system
    $ sudo mv relay-worker.service /etc/systemd/system

    After saving your service file, you can start the service for the first time with the usual systemctl command

    $ sudo systemctl daemon-reload
    $ sudo systemctl enable relay-api
    $ sudo systemctl enable relay-worker
    $ sudo systemctl start relay-api
    $ sudo systemctl start relay-worker

    Verify that it is running

    $ systemctl status relay-api
    $ systemctl status relay-worker

    Stop services

    $ sudo systemctl stop relay-api
    $ sudo systemctl stop relay-worker

Clone this wiki locally