# Quick Start: ```sh git clone https://gogs.halsbox.ru/RRT/pbx.git cd pbx cp .env.dist .env cp app.env.dist app.env ``` Edit `.env` and `app.env` with your preffered editor. Adjust environment variables for your needs. The most important variables to set are: | Variable | Description | | -------- | ----------- | | PERSISTENT_STORAGE_PATH | Host path for persistent data storage | | APP_FQDN | Domain name of the app | | APP_AMI_HOST | IP address of host (by default Asterisk runs in host network mode) | | APP_AMI_USERNAME | AMI username for the app | | APP_AMI_SECRET | AMI password for the app | | APP_AUTH_HEADER | HTTP header to use for the app auth | | APP_AUTH_SECRET | Secret string to authorize access to the app | | MYSQL_ROOT_PASSWORD | Set this to some secure password | | MYSQL_PASSWORD | Set this to some secure password | | FREEPBX_AMPMGRPASS | Password for Freepbx builtin AMI admin user, set it to some secure password | | FREEPBX_CDRDBPASS | Set it to same value as MYSQL_PASSWORD | | SENDMAIL_TG | Change to "true" if your want all mail from PBX to be forwarded to Telegram | | TG_BOT_APIKEY | Create Telegram bot using BotFather and put your new bot API key here | | TG_BOT_CHATID | Set destination Telegram User Id or Chat Id | | HTTPD_HTTPS_ENABLED | Set to "true" to enable HTTPS for Freepbx | | HTTPD_REDIRECT_HTTP_TO_HTTPS | Set to "true" to redirect HTTP requests to HTTPS | | LETSENCRYPT_ENABLED | Set to "true" to automatically request and maintain LetsEncrypt cert for HTTPS | | SMTP_MAIL_FROM | Change following to desired value. Not required if SENDMAIL_TG=true. | | ROOT_MAILTO | Change following to desired value. Not required if SENDMAIL_TG=true. | | FAIL2BAN_DEFAULT_DESTEMAIL | Change following to desired value. Not required if SENDMAIL_TG=true. | | FAIL2BAN_DEFAULT_SENDER | Change following to desired value. Not required if SENDMAIL_TG=true. | Run: ```sh docker-compose build ``` Wait paitently until you see: `Successfully tagged halsbox/docker-freepbx:latest` If running for first time it can take long to build everything. Run: ``` docker-compose up -d ``` Run: ``` docker-compose logs -f pbx ``` Watch pbx container initialization for errors and wait for: ` fail2ban entered RUNNING state, process has stayed up for > than 5 seconds` Close container log output with `Ctrl+C` keys. Restart container one extra time with `docker-compose restart pbx` if you set `LETSENCRYPT_ENABLED` to `true`. Open the address you set for APP_FQDN in browser and configure Freepbx superadmin username and password. Proceed to voice language configuration. Finally press "Apply Config" button. Run: ```sh docker-compose logs -f app ``` Open `http://APP_FQDN:8000/ui` Test the API with youre configured `APP_AUTH_SECRET` # Upgrading: ```sh git pull docker-compose build docker-compose up -d ``` # Start from scratch: ```sh docker-compose stop docker compose rm ``` remove the `PERSISTENT_STORAGE_PATH` directory, e.g.: ```sh rm -rf ./data ``` Repeat steps from Quick Start: ``` git pull docker-compose build docker-compose up -d ```