From a new server to sihub.at
As of October 10, 2026. This guide sets up a new Ubuntu 24.04 LTS server with SIHub. The existing application remains Flask/Gunicorn; Next.js, FastAPI and LangGraph are not prerequisites. Apache keeps ports 80/443; Docker publishes the app only on 127.0.0.1:5090. Telephony and media run via LiveKit Cloud; no separate public SIP/RTP server is installed on this server.
For website/portal hosting with existing Apache2: First use the Apache quick start and the instructions in the repository at apache2/README.md. sudo bash apache2/install.sh prepare sets up a direct Gunicorn service. Section 5 of this server guide contains the matching Apache/certificate commands. The following Docker, MariaDB, and voice worker steps belong to the full real-time telephony stack.
The provided server plan specifies 8 vCPU/32 GB for the app host, a separate database service, and two voice workers as an initial design. Compose initially provides a verifiable installation on one host with logically separated services. Two containers on the same host do not provide failover. 20 simultaneous conversations remain a target to be measured, not a capacity that has already been proven. The euro amounts in the plan are budget assumptions, not current provider offers.
1. Prepare access, IP and DNS
Note the actual assigned public IPv4 address. Manage the DNS zone sihub.at and create an A record for the main domain (@ or an empty name field, depending on the provider) → actual public server IPv4 in the zone. Internal addresses such as 192.168.x.x are not a valid target for this public DNS record. Only create an AAAA record if IPv6 actually works on the server and in its firewall. SERVER_IPV4 in examples is a placeholder, not a real IP. This template uses only sihub.at; www.sihub.at is optional and, if needed, must be set up separately in DNS, Apache, and the certificate.
If you want to publish the current server with a private 192.168.x.x-address: Use either a VPS with a public IPv4 address or your router's public IPv4 address that is actually reachable from outside. In the router, you then forward TCP 80 and 443 to this server's private address; the DNS A record points to the router's public address. Without a reachable public address, for example behind carrier-grade NAT, you first need a suitable connection or a public VPS. If dig for the domain returns NXDOMAIN as the result, check its registration, the configured name servers, and the DNS zone at the provider. Certificates are issued only once DNS works and HTTP is reachable from outside.
First sign in with your existing SSH key. Create a separate sudo account for operation; test signing in with it in a second terminal before you disable root/password login. For a fresh server, the SSH configuration can then look like this:
# /etc/ssh/sshd_config.d/90-aihub.conf
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
Before a reload, run sudo sshd -t and keep the existing session open. On an existing host, its SSH/firewall rules and services must be taken into account beforehand; these project files do not change any other VirtualHost.
sudo apt-get update
sudo apt-get install -y ca-certificates curl dnsutils git python3 apache2 certbot wireguard
dig +short A sihub.at
dig +short AAAA sihub.at
sudo ss -lntp
sudo apache2ctl -S
The DNS response must match your server. Port 22 for SSH and 80/443 for HTTP/TLS must be reachable; WireGuard later needs UDP 51820. MariaDB, Redis, and the voice workers do not get any public port forwarding. Docker publishing and host firewalls interact separately; here, the loopback bindings prevent the internal services from being exposed publicly. Docker firewall behavior
2. Install Docker from the official Docker repository
If Docker is already set up for other projects, use the existing supported installation. On the new server:
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod 0644 /etc/apt/keyrings/docker.asc
. /etc/os-release
AIHUB_ARCH="$(dpkg --print-architecture)"
printf 'Types: deb\nURIs: https://download.docker.com/linux/ubuntu\nSuites: %s\nComponents: stable\nArchitectures: %s\nSigned-By: /etc/apt/keyrings/docker.asc\n' "$VERSION_CODENAME" "$AIHUB_ARCH" | sudo tee /etc/apt/sources.list.d/docker.sources
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker version
sudo docker compose version
Use sudo docker or a deliberately configured rootless setup. Membership in the docker-group grants far-reaching host privileges and is not assigned automatically here. Official Ubuntu installation, Docker permissions
3. Set up the project and operator environment
Transfer the finished SIHub project to /var/www/SIHub; in the folder, app.py, deploy/compose.yml, voice_worker/, requirements-mariadb.txt and requirements-production.txt are required. Use your actual repository/transfer method; an invented public clone URL is not needed.
The project files are located in /var/www/SIHub. For an existing server installation, keep using its configured database and runtime. The technical variable names AIHUB_*, the Compose project aihub, its Redis/app volume, and the Redis and service names remain compatible. The database is switched to MariaDB with its own mariadb_data-volume; an old DB volume is kept as the source. Do not prepare a new operator file if an existing installation is already configured; adjust the public URL there and take over the session keys, provider keys, and Redis credentials. The MariaDB credentials and DSN must match; MariaDB migration describes the process.
cd /var/www/SIHub
python3 deploy/prepare_environment.py
chmod 600 deploy/.env.production
sudoedit deploy/.env.production
The helper creates new session/worker/DB/Redis/Grafana/signature keys directly in deploy/.env.production. It does not print any key values and does not overwrite an existing operator file. deploy/secrets/redis.acl contains only a password hash. Add the central provider access to the file, not as shell arguments and not in the browser. The normal container start checks the configuration, data migration, and a real operator AI response before the web start. There is no test mode as a substitute for missing provider credentials.
Important values: AIHUB_PUBLIC_URL=https://sihub.at, AIHUB_SECURE_COOKIES=1, AIHUB_TRUST_PROXY=1, DATABASE_URL=mariadb+pymysql://sihub:...@mariadb:3306/SIHub, AIHUB_REDIS_URL=redis://aihub:...@redis:6379/0. The generated hex password is URL-safe; other passwords must be correctly URL-encoded for a DSN.
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml config --quiet
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml build app
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml up -d --wait mariadb redis
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml run --rm --no-deps app python manage.py init-db
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml run --rm --no-deps app python manage.py schema-status
config --quiet checks the template without printing the resolved secret values. The app image uses Python 3.12 and runs as UID 10001. MariaDB 10.11 and Redis 7.4 are the major versions chosen here; review and pin image digests for your approved production release. MariaDB maintenance policy, Redis ACL
MariaDB stores users, agents, settings and all other persistent platform data in the database SIHub. init-db checks the complete bundled schema, adds missing tables/columns/indexes, and reports the changes made. The same reconciliation runs on every app start under a database-specific lock; schema-status reads the current/target state without making changes. After a backup and a new repository version, the new app version is all the schema needs: rebuild the app image and start it with up -d --build app. Creating tables manually with SQL is not required. The limits of the automatic sync and the direct Apache update path are described in Database operations.
4. Migrate existing SQLite data or start fresh
New installation: Skip the migration and create an operator account below.
Existing SIHub installation: First follow the Migration to MariaDB. Stop the existing SIHub writers, back up the source database unchanged and import it with scripts/migrate_to_mariadb.py into the empty MariaDB target tables. Transfer existing session/API/telephony keys to the operator file. Do not create a new user account before the import. The import takes over IDs and password/API key hashes and checks row counts; the source is preserved.
Only for a new installation do you then create an account:
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml run --rm --no-deps app python manage.py create-admin --email DEINE_ADMIN_EMAIL --workspace-name SIHub
Replace DEINE_ADMIN_EMAIL; the password is requested without being displayed. After a migration, sign in with a migrated account. First check the basic configuration, then start the app:
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml run --rm --no-deps app python manage.py check-config
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml up -d --wait app
curl --fail http://127.0.0.1:5090/health
Check sign-in, knowledge, agent versions, and conversation histories. If port 5090 is already in use, stop the old SIHub instance specifically. If the switch fails, stop the new SIHub app/voice containers and start the old service you noted with its original SQLite file. After write access to MariaDB, a rollback to the old source database is only possible with an explicitly planned back-migration of the new data.
5. Enable the HTTP VirtualHost and only then issue TLS certificates
The HTTP bootstrap file references no certificates that do not yet exist:
sudo install -d -m 0755 /var/www/SIHub-acme/.well-known/acme-challenge
sudo cp apache2/sihub-http.conf /etc/apache2/sites-available/sihub-http.conf
sudo a2enmod proxy proxy_http headers rewrite ssl
sudo a2ensite sihub-http.conf
sudo apache2ctl configtest
sudo systemctl reload apache2
Write a harmless test file and also fetch it from another network (for example, mobile data). The response must be sihub-acme-ok exactly; a request for the directory alone may correctly return 403.
printf '%s\n' sihub-acme-ok | sudo tee /var/www/SIHub-acme/.well-known/acme-challenge/check.txt
curl --fail http://sihub.at/.well-known/acme-challenge/check.txt
sudo rm /var/www/SIHub-acme/.well-known/acme-challenge/check.txt
Then set up the certificate:
sudo certbot certonly --webroot -w /var/www/SIHub-acme -d sihub.at
sudo test -s /etc/letsencrypt/live/sihub.at/fullchain.pem
sudo cp apache2/sihub-tls.conf /etc/apache2/sites-available/sihub-tls.conf
sudo a2dissite sihub-http.conf
sudo a2ensite sihub-tls.conf
sudo apache2ctl configtest
sudo systemctl reload apache2
curl --fail https://sihub.at/health
The final file keeps the ACME webroot for renewals and redirects other HTTP requests to HTTPS. Only the new SIHub sites are enabled/disabled. Certbot webroot method
sudo install -m 0755 deploy/certbot-apache-reload.sh /etc/letsencrypt/renewal-hooks/deploy/aihub-apache-reload
sudo certbot renew --dry-run
sudo systemctl list-timers certbot.timer
If no automatic Certbot timer is installed, set up renewal explicitly for your installation. The deploy hook checks Apache before the reload. Then test registration/sign-in in an HTTPS browser session; secure cookies do not work as a complete sign-in flow over the previous HTTP bootstrap.
6. Approve the workspace and telephony
Create knowledge and an assistant, test first without provider actions, and publish a version. A platform administrator then approves the workspace under Users, Workspaces & Agents → Workspaces → Live operation for live use.
For LiveKit keys, SIP trunks, dispatch, and the providers, see LiveKit setup for details. Start the voice workers only after these configurations:
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml --profile voice up -d --build
This full Compose deploy builds and updates the app and voice workers together on every update so that the internal billing protocol matches. The private operator file and data volumes are preserved. A plain build does not activate any services. The worker build installs the pinned framework/provider packages and requires internet access; the Silero package includes its VAD model. Starting the containers registers the workers but does not trigger an automatic paid test call. Two workers with 15 job slots each are a configuration, not a measured processing commitment. For real host redundancy, distribute workers and database across separate hosts with suitable private/HTTPS connections and separate VPN keys.
7. Monitoring, maintenance and backups
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml --profile monitoring up -d blackbox prometheus grafana otel
Prometheus checks internal app/worker endpoints and the public HTTPS domain. Grafana gets the “SIHub Betriebsstatus” (operations status) dashboard. Access is via SSH tunnel, not via public monitoring ports:
ssh -L 3000:127.0.0.1:3000 -L 9090:127.0.0.1:9090 DEIN_SSH_KONTO@SERVER_IPV4
Open locally http://127.0.0.1:3000; the Grafana password is only in the operator file. OTel receives OTLP metrics internally; this does not yet enable complete tracing of every app call. Alert rules are evaluated in Prometheus, but without an additionally configured Alertmanager they have no external alert delivery. Running Prometheus in Docker, Grafana Docker configuration
For daily retention, use the Compose maintenance service retention from the prepared files in deploy/systemd/; it starts daily from 03:15 Europe/Vienna. notifications and inbox-worker are part of the normal Compose deployment and start automatically after a successful app health check. Every ten seconds, the notification outbox also processes retries of registration approvals and approved device notifications; the inbox worker fetches configured mailboxes every minute and checks enabled appointment assistants. The persistent web push keys are kept in the private app_instance-volume. No additional notifications timer is required. With telephony enabled, the voice reaper closes orphaned rooms every minute after their lease expires. The former .venv-service examples apply to direct Python operation and must not start the same workload alongside Docker at the same time.
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml run --rm --no-deps retention python manage.py purge --dry-run
sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml run --rm --no-deps retention
sudo cp deploy/systemd/aihub-compose-retention.service deploy/systemd/aihub-compose-retention.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now aihub-compose-retention.timer
Registration emails use the existing SMTP configuration and do not require a customer workspace to be approved for live use. The older Compose notifications timer remains compatible with a limited single run; it is not additionally set up for new installations.
If telephony is enabled, also install the reaper; it does not start calls but can close its own expired LiveKit rooms:
sudo cp deploy/systemd/aihub-compose-voice-reaper.service deploy/systemd/aihub-compose-voice-reaper.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now aihub-compose-voice-reaper.timer
sudo systemctl list-timers aihub-compose-voice-reaper.timer aihub-compose-retention.timer
A MariaDB backup works without a DSN/password in process arguments via the prepared helper:
sudo bash deploy/backup-mariadb.sh
The helper writes a new dump to /var/backups/sihub with mode 0600; operator keys are kept separately. Test a restore on a separate database following Backup and restore, before you consider a backup usable. MariaDB dumps
The final approval step is the Capacity acceptance. A working website or /health does not yet prove 20 parallel calls or legal compliance.