Binary Installation
Binary Installation
Section titled “Binary Installation”Pre-built binaries are available for all major platforms, making it easy to deploy Alita Robot without Docker or building from source.
Available Platforms
Section titled “Available Platforms”| Platform | Architecture | Binary Name |
|---|---|---|
| Linux | amd64 | alita_robot_linux_amd64 |
| Linux | arm64 | alita_robot_linux_arm64 |
| macOS | amd64 (Intel) | alita_robot_macOS_amd64 |
| macOS | arm64 (Apple Silicon) | alita_robot_macOS_arm64 |
| Windows | amd64 | alita_robot_windows_amd64.exe |
| Windows | arm64 | alita_robot_windows_arm64.exe |
Download
Section titled “Download”Download the latest release from GitHub:
# Get the latest release versionVERSION=$(curl -s https://api.github.com/repos/divkix/Alita_Robot/releases/latest | grep tag_name | cut -d '"' -f 4)
# Download for Linux amd64curl -LO "https://github.com/divkix/Alita_Robot/releases/download/${VERSION}/alita_robot_${VERSION}_linux_amd64.tar.gz"
# Extracttar -xzf alita_robot_${VERSION}_linux_amd64.tar.gz
# Make executablechmod +x alita_robotOr visit the GitHub Releases page to download manually.
Verify Checksums
Section titled “Verify Checksums”Each release includes a checksums.txt file with SHA256 hashes:
# Download checksumscurl -LO "https://github.com/divkix/Alita_Robot/releases/download/${VERSION}/checksums.txt"
# Verifysha256sum -c checksums.txt --ignore-missingQuick Start
Section titled “Quick Start”- Download and extract the binary
- Create a configuration file:
cat > .env << EOFBOT_TOKEN=your_bot_tokenOWNER_ID=your_telegram_idMESSAGE_DUMP=-100xxxxxxxxxxDATABASE_URL=postgres://user:pass@localhost:5432/alitaREDIS_ADDRESS=localhost:6379EOF- Run the bot:
./alita_robotSystemd Service (Linux)
Section titled “Systemd Service (Linux)”For production deployments on Linux, run Alita Robot as a systemd service.
Create Service File
Section titled “Create Service File”sudo nano /etc/systemd/system/alita-robot.serviceAdd the following content:
[Unit]Description=Alita Robot Telegram BotAfter=network.target postgresql.service redis.serviceWants=postgresql.service redis.service
[Service]Type=simpleUser=alitaGroup=alitaWorkingDirectory=/opt/alita-robotExecStart=/opt/alita-robot/alita_robotRestart=alwaysRestartSec=5StandardOutput=journalStandardError=journal
# Environment fileEnvironmentFile=/opt/alita-robot/.env
# Resource limitsLimitNOFILE=65535MemoryMax=1GCPUQuota=100%
# Security hardeningNoNewPrivileges=trueProtectSystem=strictProtectHome=truePrivateTmp=truePrivateDevices=trueProtectKernelTunables=trueProtectKernelModules=trueProtectControlGroups=trueRestrictSUIDSGID=trueRestrictNamespaces=true
[Install]WantedBy=multi-user.target# Create user and directorysudo useradd -r -s /bin/false alitasudo mkdir -p /opt/alita-robotsudo chown alita:alita /opt/alita-robot
# Copy binary and configsudo cp alita_robot /opt/alita-robot/sudo cp .env /opt/alita-robot/sudo chmod 600 /opt/alita-robot/.envsudo chown alita:alita /opt/alita-robot/*
# Copy migrations if using auto-migratesudo cp -r migrations /opt/alita-robot/
# Reload systemd and enable servicesudo systemctl daemon-reloadsudo systemctl enable alita-robotService Management
Section titled “Service Management”# Start the servicesudo systemctl start alita-robot
# Check statussudo systemctl status alita-robot
# View logssudo journalctl -u alita-robot -f
# Stop the servicesudo systemctl stop alita-robot
# Restart the servicesudo systemctl restart alita-robotLog Rotation
Section titled “Log Rotation”Configure log rotation for journald logs:
sudo nano /etc/systemd/journald.conf.d/alita-robot.conf[Journal]SystemMaxUse=500MSystemMaxFileSize=50MMaxRetentionSec=1monthOr 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
Section titled “Environment File”Create /opt/alita-robot/.env:
# RequiredBOT_TOKEN=your_bot_tokenOWNER_ID=your_telegram_idMESSAGE_DUMP=-100xxxxxxxxxxDATABASE_URL=postgres://user:pass@localhost:5432/alitaREDIS_ADDRESS=localhost:6379
# Optional but recommendedAUTO_MIGRATE=trueHTTP_PORT=8080DEBUG=false
# Webhook mode (optional)# USE_WEBHOOKS=true# WEBHOOK_DOMAIN=https://your-domain.com# WEBHOOK_SECRET=your-secret
# Performance tuningDB_MAX_OPEN_CONNS=100DISPATCHER_MAX_ROUTINES=200macOS Installation
Section titled “macOS Installation”Using Homebrew (if available)
Section titled “Using Homebrew (if available)”The binary can be installed manually:
# Download for Apple Siliconcurl -LO "https://github.com/divkix/Alita_Robot/releases/latest/download/alita_robot_macOS_arm64.tar.gz"tar -xzf alita_robot_macOS_arm64.tar.gzchmod +x alita_robot
# Run./alita_robotCreate a Launch Agent (Optional)
Section titled “Create a Launch Agent (Optional)”For automatic startup on macOS:
mkdir -p ~/Library/LaunchAgentsnano ~/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.plistWindows Installation
Section titled “Windows Installation”Download and Extract
Section titled “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
Section titled “Run as a Service”Use NSSM (Non-Sucking Service Manager) to run as a Windows service:
# Install NSSMchoco install nssm
# Install servicenssm install AlitaRobot C:\alita-robot\alita_robot.exenssm set AlitaRobot AppDirectory C:\alita-robotnssm set AlitaRobot AppEnvironmentExtra BOT_TOKEN=your_tokennssm set AlitaRobot Start SERVICE_AUTO_START
# Start servicenssm start AlitaRobotUpdating
Section titled “Updating”To update the binary:
- Stop the service
- Download the new binary
- Replace the existing binary
- Start the service
# Linux examplesudo systemctl stop alita-robotcurl -LO "https://github.com/divkix/Alita_Robot/releases/latest/download/alita_robot_linux_amd64.tar.gz"tar -xzf alita_robot_linux_amd64.tar.gzsudo cp alita_robot /opt/alita-robot/sudo systemctl start alita-robotTroubleshooting
Section titled “Troubleshooting”Permission denied
Section titled “Permission denied”chmod +x alita_robotLibrary not found
Section titled “Library not found”The binary is statically compiled, so no external libraries are needed. If you see library errors, ensure you downloaded the correct platform.
Cannot connect to database
Section titled “Cannot connect to database”Verify PostgreSQL is running and accessible:
psql -h localhost -U postgres -d alita -c "SELECT 1"Service won’t start
Section titled “Service won’t start”Check the logs:
sudo journalctl -u alita-robot -n 50Common issues:
- Invalid environment variables
- Database connection failed
- Redis not running