Installing the bot on hosting
This section describes how to install TG Support Bot on hosting without using Docker Compose.
Alternative installation method
Installation via Docker Compose automatically deploys all the required services: the database, logging, and monitoring. When installing on hosting you will need to create the database in advance and specify its credentials yourself in the .env file.
Cloning the repository
Go to the project directory and make sure it is empty:
ls -AIf the directory is not empty, clear it:
find . -mindepth 1 -deleteClone the repository:
git clone https://github.com/prog-time/tg-support-bot.git .Creating a bot and a group in Telegram
- Open @BotFather and create a new bot with the
/newbotcommand; - Set a name and a username for the bot;
- Copy and save the token you receive;
- Create a new private Telegram group;
- Add the bot to the group and make it an administrator;
- In the group settings, enable the ability to create topics;
- To find out the group ID, temporarily add the @getMyId bot (or a similar one) to it. Once you have the ID, remove it from the group.
Creating the .env file
Copy the configuration file from the template:
cp .env.example .envFilling in the .env
Open the .env file and replace the variable values with real data:
- Domain
MAIN_DOMAIN=example.com
APP_URL=https://example.com- Database credentials
DB_CONNECTION=pgsql
DB_HOST=pgdb
DB_PORT=5432
DB_DATABASE=database_name
DB_USERNAME=username
DB_PASSWORD=passwordIntegration parameters are configured in the admin panel.
Applying database migrations
After configuring the database connection, run the migrations to create the necessary tables:
php artisan migrateRedirecting requests to the public directory
TIP
This step may vary depending on your hosting. If you cannot get the bot running, contact your hosting provider's technical support or ask a question in our Telegram community — t.me/pt_tg_support.
For the application to work correctly, all incoming requests must be directed to the public directory. Create a .htaccess file in the project root with the following contents:
RewriteEngine On
RewriteRule (.*) public/$1After that, make sure requests are processed correctly through public/index.php.