Systemd Deployment
For bare-metal or VM deployments, Mezite provides systemd unit files in
the deploy/ directory.
mezhub.service
The main server unit runs the auth and proxy services.
deploy/mezhub.service ini
[Unit]
Description=Mezite Server (Auth + Proxy)
After=network.target postgresql.service
Wants=postgresql.service
[Service]
Type=simple
User=mezite
Group=mezite
EnvironmentFile=/etc/mezite/mezhub.env
ExecStart=/usr/local/bin/mezhub --config=/etc/mezite/mezite.yaml
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target mezd.service
The agent unit runs on each SSH node.
deploy/mezd.service ini
[Unit]
Description=Mezite SSH Agent
After=network.target
[Service]
Type=simple
User=root
EnvironmentFile=/etc/mezite/mezd.env
ExecStart=/usr/local/bin/mezd start
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target Environment Files
Each service reads its configuration from an environment file. Place these
in /etc/mezite/.
/etc/mezite/mezhub.env bash
MEZITE_DATA_DIR=/var/lib/mezite
MEZITE_AUTH_LISTEN_ADDR=0.0.0.0:3025
MEZITE_PROXY_LISTEN_ADDR=0.0.0.0:3080
MEZITE_DB_HOST=localhost
MEZITE_DB_PORT=5432
MEZITE_DB_USER=mezite
MEZITE_DB_PASSWORD=secret
MEZITE_DB_NAME=mezite
MEZITE_DB_SSLMODE=require
MEZITE_LOG_LEVEL=info /etc/mezite/mezd.env bash
MEZITE_AUTH_ADDR=mezite.example.com:3025
MEZITE_PROXY_ADDR=mezite.example.com:3024
MEZITE_TOKEN=<join-token>
MEZITE_DATA_DIR=/var/lib/mezd
MEZITE_LOG_LEVEL=info Installation
Install and enable services bash
# Copy binaries
sudo cp build/mezhub /usr/local/bin/
sudo cp build/mezd /usr/local/bin/
# Create system user
sudo useradd --system --no-create-home mezite
# Install unit files
sudo cp deploy/mezhub.service /etc/systemd/system/
sudo cp deploy/mezd.service /etc/systemd/system/
# Create config directory
sudo mkdir -p /etc/mezite /var/lib/mezite
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable --now mezhub
sudo systemctl enable --now mezd Log Management
View logs with journalctl:
Viewing logs bash
# Follow mezhub logs
journalctl -u mezhub -f
# View agent logs from the last hour
journalctl -u mezd --since "1 hour ago"
# Filter by priority
journalctl -u mezhub -p err