Skip to content

Server Management

Terminal window
mix deps.get
mix run --no-halt
Terminal window
# Build a release
MIX_ENV=prod mix release
# Start in the background
_build/prod/rel/elixircd/bin/elixircd daemon
# Stop
_build/prod/rel/elixircd/bin/elixircd stop
# Attach to a running node
_build/prod/rel/elixircd/bin/elixircd remote
Terminal window
docker run -d \
-p 6667:6667 \
-p 6697:6697 \
-v /etc/elixircd:/app/config \
elixircd/elixircd:latest

The primary configuration file is config/elixircd.exs (or wherever RELEASE_COOKIE/MIX_ENV points). After editing, reload with:

/rehash

REHASH re-reads the configuration file and applies changes to:

  • Server name/description/MOTD
  • Operator credentials
  • Rate limiting settings
  • Cloaking settings
  • WebIRC entries

The Message of the Day is stored in a file referenced by the config:

config :elixircd, :server,
motd_file: "/etc/elixircd/motd.txt"

Edit the file and run /rehash to update the MOTD. Connected users see the new MOTD on their next /motd request or reconnect.

To update an operator password:

  1. Generate a new Argon2id hash:

    Argon2.hash_pwd_salt("newpassword")
  2. Update the password field in the oper config

  3. Run /rehash

The old credentials are immediately invalidated. Active operator sessions keep their status until they de-oper or disconnect.

When certificates are renewed:

  1. Replace certificate and key files at the configured paths
  2. Restart the server (TLS listener changes require restart)

For Let’s Encrypt with auto-renewal, add a deploy hook:

/etc/letsencrypt/renewal-hooks/deploy/elixircd.sh
#!/bin/bash
systemctl restart elixircd

Example systemd unit for production:

[Unit]
Description=ElixIRCd IRC Server
After=network.target
[Service]
Type=forking
User=elixircd
Group=elixircd
WorkingDirectory=/opt/elixircd
ExecStart=/opt/elixircd/bin/elixircd daemon
ExecStop=/opt/elixircd/bin/elixircd stop
Restart=on-failure
RestartSec=5s
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

Enable and start:

Terminal window
sudo systemctl enable elixircd
sudo systemctl start elixircd

ElixIRCd writes logs via Elixir’s Logger. Default output is stdout/stderr captured by systemd or the release logger.

Configure log level in config/runtime.exs or environment:

config :logger, level: :info

Available levels: :debug, :info, :warning, :error

ElixIRCd uses Mnesia (via Memento) for persistent data storage:

  • Registered nicknames and accounts
  • Registered channels and their settings
  • Access lists, suspend records

Mnesia stores data in the directory specified by MNESIA_BASE or the application’s data directory. To back up:

Terminal window
# Stop the server first, or use Mnesia's online backup
cp -r /var/lib/elixircd/Mnesia.elixircd@hostname /backup/

Or from an IEx session:

:mnesia.backup('/backup/elixircd-backup')
  1. Pull new code or download new release
  2. Review the changelog for breaking configuration changes
  3. Run mix deps.get && mix compile (or rebuild the release)
  4. Restart the server

For zero-downtime upgrades in OTP hot-upgrade scenarios, consult the Elixir/OTP release documentation.

From an IRC operator perspective:

/stats u # Uptime and connection count
/lusers # User/channel/server counts
/version # Server version and build info
/admin # Admin contact info

From the system:

Terminal window
# Check if the port is listening
ss -tlnp | grep 6697
# Check the process
ps aux | grep elixircd
# Check memory usage
_build/prod/rel/elixircd/bin/elixircd remote
# Then in IEx:
:erlang.memory()