Binary Installation
Deploy Alita Robot using pre-built binaries.
Pre-built binaries are available for all major platforms, making it easy to deploy Alita Robot without Docker or building from source.
Available Platforms
| Platform | Architecture | Archive Name |
|---|---|---|
| Linux | amd64 | alita_robot_linux_amd64.tar.gz |
| Linux | arm64 | alita_robot_linux_arm64.tar.gz |
| macOS | amd64 (Intel) | alita_robot_macOS_amd64.tar.gz |
| macOS | arm64 (Apple Silicon) | alita_robot_macOS_arm64.tar.gz |
| Windows | amd64 | alita_robot_windows_amd64.zip |
| Windows | arm64 | alita_robot_windows_arm64.zip |
Download
Download the latest release from GitHub:
# Get the latest release version
VERSION=$(curl -s https://api.github.com/repos/divkix/Alita_Robot/releases/latest | grep tag_name | cut -d '"' -f 4)
# Download for Linux amd64
curl -LO "https://github.com/divkix/Alita_Robot/releases/download/${VERSION}/alita_robot_${VERSION}_linux_amd64.tar.gz"
# Extract
tar -xzf alita_robot_${VERSION}_linux_amd64.tar.gz
# Make executable
chmod +x alita_robot
Or visit the GitHub Releases page to download manually.
Verify Checksums
Each release includes a checksums.txt file with SHA256 hashes:
# Download checksums
curl -LO "https://github.com/divkix/Alita_Robot/releases/download/${VERSION}/checksums.txt"
# Verify
sha256sum -c checksums.txt --ignore-missing
Quick Start
Download and extract the binary
See the Download section above.
Create a configuration file
cat > .env << EOF
BOT_TOKEN=your_bot_token
OWNER_ID=your_telegram_id
MESSAGE_DUMP=-100xxxxxxxxxx
DATABASE_URL=postgresql://alita:change-me@localhost:5432/alita
REDIS_ADDRESS=localhost:6379
EOFRun the bot
./alita_robotSystemd Service (Linux)
For production deployments on Linux, run Alita Robot as a systemd service.
Create Service File
sudo nano /etc/systemd/system/alita-robot.service
Add the following content:
[Unit]
Description=Alita Robot Telegram Bot
After=network.target postgresql.service redis.service
Wants=postgresql.service redis.service
[Service]
Type=simple
User=alita
Group=alita
WorkingDirectory=/opt/alita-robot
ExecStart=/opt/alita-robot/alita_robot
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
# Environment file
EnvironmentFile=/opt/alita-robot/.env
# Resource limits
LimitNOFILE=65535
MemoryMax=1G
CPUQuota=100%
# Security hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictNamespaces=true
[Install]
WantedBy=multi-user.target
Setup
Create user and directory
sudo useradd -r -s /bin/false alita
sudo mkdir -p /opt/alita-robot
sudo chown alita:alita /opt/alita-robotCopy binary and config
sudo cp alita_robot /opt/alita-robot/
sudo cp .env /opt/alita-robot/
sudo chmod 600 /opt/alita-robot/.env
sudo chown alita:alita /opt/alita-robot/*Copy migrations if using auto-migrate
sudo cp -r migrations /opt/alita-robot/Reload systemd and enable service
sudo systemctl daemon-reload
sudo systemctl enable alita-robotService Management
# Start the service
sudo systemctl start alita-robot
# Check status
sudo systemctl status alita-robot
# View logs
sudo journalctl -u alita-robot -f
# Stop the service
sudo systemctl stop alita-robot
# Restart the service
sudo systemctl restart alita-robot
Log Rotation
Configure log rotation for journald logs:
sudo nano /etc/systemd/journald.conf.d/alita-robot.conf
[Journal]
SystemMaxUse=500M
SystemMaxFileSize=50M
MaxRetentionSec=1month
Or use a dedicated log file with logrotate:
sudo nano /etc/logrotate.d/alita-robot
/var/log/alita-robot/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 640 alita alita
postrotate
systemctl reload alita-robot > /dev/null 2>&1 || true
endscript
}
Environment File
Create /opt/alita-robot/.env:
# Required
BOT_TOKEN=your_bot_token
OWNER_ID=your_telegram_id
MESSAGE_DUMP=-100xxxxxxxxxx
DATABASE_URL=postgresql://alita:change-me@localhost:5432/alita
# Redis endpoint (optional when Redis is at localhost:6379)
# REDIS_ADDRESS=redis-host:6379
# REDIS_URL=redis://user:password@redis-host:6379/1
# Optional
AUTO_MIGRATE=true
HTTP_PORT=8080
DEBUG=false
# Webhook mode (optional)
# USE_WEBHOOKS=true
# WEBHOOK_DOMAIN=https://your-domain.com
# WEBHOOK_SECRET=your-secret
# Performance tuning
DB_MAX_OPEN_CONNS=200
DISPATCHER_MAX_ROUTINES=200
macOS Installation
# Get the latest release version
VERSION=$(curl -s https://api.github.com/repos/divkix/Alita_Robot/releases/latest | grep tag_name | cut -d '"' -f 4)
# Download and extract
curl -LO "https://github.com/divkix/Alita_Robot/releases/download/${VERSION}/alita_robot_${VERSION}_macOS_arm64.tar.gz"
tar -xzf alita_robot_${VERSION}_macOS_arm64.tar.gz
chmod +x alita_robot
./alita_robot# Get the latest release version
VERSION=$(curl -s https://api.github.com/repos/divkix/Alita_Robot/releases/latest | grep tag_name | cut -d '"' -f 4)
# Download and extract
curl -LO "https://github.com/divkix/Alita_Robot/releases/download/${VERSION}/alita_robot_${VERSION}_macOS_amd64.tar.gz"
tar -xzf alita_robot_${VERSION}_macOS_amd64.tar.gz
chmod +x alita_robot
./alita_robotCreate a Launch Agent (Optional)
For automatic startup on macOS:
mkdir -p ~/Library/LaunchAgents
nano ~/Library/LaunchAgents/com.alita-robot.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.alita-robot</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/alita_robot</string>
</array>
<key>WorkingDirectory</key>
<string>/usr/local/etc/alita-robot</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/usr/local/var/log/alita-robot.log</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/alita-robot.log</string>
</dict>
</plist>
Load the agent:
launchctl load ~/Library/LaunchAgents/com.alita-robot.plist
Windows Installation
Download and Extract
- Download the Windows binary from GitHub Releases
- Extract the ZIP file to a directory (e.g.,
C:\alita-robot) - Create a
.envfile in the same directory
Run as a Service
Use NSSM (Non-Sucking Service Manager) to run as a Windows service:
# Install NSSM
choco install nssm
# Install service
nssm install AlitaRobot C:\alita-robot\alita_robot.exe
nssm set AlitaRobot AppDirectory C:\alita-robot
nssm set AlitaRobot AppEnvironmentExtra BOT_TOKEN=your_token
nssm set AlitaRobot Start SERVICE_AUTO_START
# Start service
nssm start AlitaRobot
Updating
Stop the service
sudo systemctl stop alita-robotDownload the new binary
VERSION=$(curl -s https://api.github.com/repos/divkix/Alita_Robot/releases/latest | grep tag_name | cut -d '"' -f 4)
curl -LO "https://github.com/divkix/Alita_Robot/releases/download/${VERSION}/alita_robot_${VERSION}_linux_amd64.tar.gz"
tar -xzf alita_robot_${VERSION}_linux_amd64.tar.gzReplace the existing binary
sudo cp alita_robot /opt/alita-robot/Start the service
sudo systemctl start alita-robotTroubleshooting
Permission denied
chmod +x alita_robot
Library not found
Cannot connect to database
Verify PostgreSQL is running and accessible:
psql -h localhost -U postgres -d alita -c "SELECT 1"
Service won’t start
Check the logs:
sudo journalctl -u alita-robot -n 50
Common issues:
- Invalid environment variables
- Database connection failed
- Redis not running