Install uv as root.
sudo -i
# install script from uv docs.Clone or extract aTrain to /opt/.
sudo -i
cd /opt
git clone https://github.com/aTrainTranscription/aTrain.git
cd aTrain
uv sync --extra gui
logoutCreate aTrain folder in /srv.
sudo -i
cd /srv
mkdir aTrain
logoutPlace the following file as aTrain.service at /etc/systemd/system.
[Unit]
Description=Runs aTrain as a service
After=network.target
Wants=network-online.target
[Service]
Restart=always
Type=simple
ExecStart=/opt/aTrain/.venv/bin/aTrain start --no-native --no-show --host 0.0.0.0
Environment='ATRAIN_USER_DIR=/srv/aTrain'
Environment='WAKEPY_FAKE_SUCCESS=yes'
Environment='HF_TOKEN=<your-token>'
[Install]
WantedBy=multi-user.targetsudo nano /etc/systemd/system/aTrain.service
# paste
# CTRL + X, CTRL + Y, EnterChange --host or append --port in the 'ExecStart' line to configure those settings. Without --host, aTrain only listens on 127.0.0.1. With --host 0.0.0.0 it does not check host names or origins, so put a reverse proxy with authentication in front of it.
A Hugging Face token is required to successfully download the speaker detection model. If the download fails, remove the /srv/aTrain/models/speaker-detection folder, check the token, and if you have accepted the terms on Hugging Face, retry. After the first successful transcription with speaker detection, that environment variable can be removed.
Enable and run the service
sudo systemctl enable --now aTrain.serviceCheck if it works
# try to access in the browser
# check service status
sudo systemctl status aTrain.service
# see aTrain output
sudo journalctl -e -u aTrain.serviceYou can put this behind a reverse proxy, but prefix-path is currently not supported. If aTrain listens on 127.0.0.1 or localhost behind a proxy on the same machine, append --allow-any-host in the 'ExecStart' line. Without it, aTrain rejects requests under the proxy's host name and socket.io connections from the proxy's public origin, so the page does not load or does not respond.