Install Docker
InstallDocker if it is not already installed.
Install Docker
Install Docker
text sudo curl -fsSL https://get.docker.com | sh Installation Options
Choose the installation method based on your configuration:- Bot and panel on the same server
- Bot and panel on different servers
Use this method if the bot will run on the same server as the Remnawave panel. The bot connects to Remnawave through the internal Docker network.
Step 1: Create the project directory
mkdir /opt/remnashop && cd /opt/remnashop
Step 2: Download required files
Download the docker-compose.yml and .env files by running the following commands:
curl -o .env https://raw.githubusercontent.com/snoups/remnashop/refs/heads/main/.env.example
curl -o docker-compose.yml https://raw.githubusercontent.com/snoups/remnashop/refs/heads/main/docker-compose.prod.internal.yml
Step 3: Generate secrets
Generate secret keys by running the following commands:
sed -i "s|^APP_CRYPT_KEY=.*|APP_CRYPT_KEY=$(openssl rand -base64 32 | tr -d '\n')|" .env && sed -i "s|^BOT_SECRET_TOKEN=.*|BOT_SECRET_TOKEN=$(openssl rand -hex 64 | tr -d '\n')|" .env
sed -i "s|^DATABASE_PASSWORD=.*|DATABASE_PASSWORD=$(openssl rand -hex 24 | tr -d '\n')|" .env && sed -i "s|^REDIS_PASSWORD=.*|REDIS_PASSWORD=$(openssl rand -hex 24 | tr -d '\n')|" .env
Step 4: Configure the .env file
Open the .env file:
cd /opt/remnashop && nano .env
# Domain through which your bot is publicly accessible.
# Used for receiving webhooks from services (e.g., Telegram, payment systems).
# !!! WARNING: Specify domain WITHOUT HTTP/HTTPS and WITHOUT trailing slash.
APP_DOMAIN=change_me
# Encryption key for securing sensitive data (e.g., payment tokens) in the database.
# !!! CRITICALLY IMPORTANT: Never share this token publicly.
APP_CRYPT_KEY=change_me # SHOULD ALREADY BE SET IN STEP 3
# Telegram Bot API token. Obtain it from https://t.me/BotFather/
# !!! CRITICALLY IMPORTANT: Never share this token publicly. It grants full control over your bot.
BOT_TOKEN=change_me
# Secret token for webhook verification. Ensures webhook requests originate from Telegram.
BOT_SECRET_TOKEN=change_me # SHOULD ALREADY BE SET IN STEP 3
# Owner Telegram user ID. Grants elevated permissions.
BOT_OWNER_ID=change_me
# Telegram username of the support account used for deep-linking (without @).
BOT_SUPPORT_USERNAME=change_me
# Controls the behavior of the "connect" button:
# - empty or false -> opens the subscription page in the browser
# - true -> opens the subscription page in WebApp
# - URL (e.g., https://example.com/) -> opens the specified URL in WebApp
BOT_MINI_APP=false
# Hostname or Docker service name for connecting to the Remnawave API.
REMNAWAVE_HOST=remnawave
# API token for authenticating with the Remnawave service.
REMNAWAVE_TOKEN=change_me
# Secret token for verifying incoming webhooks from Remnawave.
# In the Remnawave Panel, this corresponds to WEBHOOK_SECRET_HEADER (env).
REMNAWAVE_WEBHOOK_SECRET=change_me
# Password for the database.
DATABASE_PASSWORD=change_me # SHOULD ALREADY BE SET IN STEP 3
REMNAWAVE_HOST=remnawave uses the container name from the Remnawave Docker network.REMNAWAVE_TOKEN variable to your panel API token. You can create a token in Remnawave Settings → API Tokens.REMNAWAVE_WEBHOOK_SECRET must match the value of WEBHOOK_SECRET_HEADER in the panel’s .env file.REMNAWAVE_COOKIE=rEmnaprx=aBCDefgh1. How to get the cookie: instructions.Step 5: Configure the webhook from the panel to the bot
Open the Remnawave panel .env file:
cd /opt/remnawave && nano .env
Set WEBHOOK_ENABLED=true and set WEBHOOK_URL to your actual bot domain:
WEBHOOK_ENABLED=true
WEBHOOK_URL=https://bot.domain.com/api/v1/remnawave
bot.domain.com with your actual domain.Find the WEBHOOK_SECRET_HEADER variable in the same file and copy its value:
WEBHOOK_SECRET_HEADER=ey1234567890qwertyuiopasdfghjklzxcvbnm
ey1234567890qwertyuiopasdfghjklzxcvbnm is shown as an example.Restart the Remnawave panel container to apply the changes:
cd /opt/remnawave && docker compose up -d
Return to the bot’s .env file and paste the copied value into REMNAWAVE_WEBHOOK_SECRET:
cd /opt/remnashop && nano .env
REMNAWAVE_WEBHOOK_SECRET=ey1234567890qwertyuiopasdfghjklzxcvbnm
REMNAWAVE_WEBHOOK_SECRET must match the value of WEBHOOK_SECRET_HEADER in the panel’s .env file.Step 6: Start the bot
docker compose up -d && docker compose logs -f -t
You can now proceed to set up the reverse proxy.
Install Reverse Proxy
Use this method if the bot will run on a different server from the Remnawave panel. The bot connects to Remnawave through an external HTTPS URL.
Step 1: Create the project directory
mkdir /opt/remnashop && cd /opt/remnashop
Step 2: Download required files
Download the docker-compose.yml and .env files by running the following commands:
curl -o .env https://raw.githubusercontent.com/snoups/remnashop/refs/heads/main/.env.example
curl -o docker-compose.yml https://raw.githubusercontent.com/snoups/remnashop/refs/heads/main/docker-compose.prod.external.yml
Step 3: Generate secrets
sed -i "s|^APP_CRYPT_KEY=.*|APP_CRYPT_KEY=$(openssl rand -base64 32 | tr -d '\n')|" .env && sed -i "s|^BOT_SECRET_TOKEN=.*|BOT_SECRET_TOKEN=$(openssl rand -hex 64 | tr -d '\n')|" .env
sed -i "s|^DATABASE_PASSWORD=.*|DATABASE_PASSWORD=$(openssl rand -hex 24 | tr -d '\n')|" .env && sed -i "s|^REDIS_PASSWORD=.*|REDIS_PASSWORD=$(openssl rand -hex 24 | tr -d '\n')|" .env
Step 4: Configure the .env file
Open the .env file:
cd /opt/remnashop && nano .env
# Domain through which your bot is publicly accessible.
# Used for receiving webhooks from services (e.g., Telegram, payment systems).
# !!! WARNING: Specify domain WITHOUT HTTP/HTTPS and WITHOUT trailing slash.
APP_DOMAIN=change_me
# Encryption key for securing sensitive data (e.g., payment tokens) in the database.
# !!! CRITICALLY IMPORTANT: Never share this token publicly.
APP_CRYPT_KEY=change_me # SHOULD ALREADY BE SET IN STEP 3
# Telegram Bot API token. Obtain it from https://t.me/BotFather/
# !!! CRITICALLY IMPORTANT: Never share this token publicly. It grants full control over your bot.
BOT_TOKEN=change_me
# Secret token for webhook verification. Ensures webhook requests originate from Telegram.
BOT_SECRET_TOKEN=change_me # SHOULD ALREADY BE SET IN STEP 3
# Owner Telegram user ID. Grants elevated permissions.
BOT_OWNER_ID=change_me
# Telegram username of the support account used for deep-linking (without @).
BOT_SUPPORT_USERNAME=change_me
# Controls the behavior of the "connect" button:
# - empty or false -> opens the subscription page in the browser
# - true -> opens the subscription page in WebApp
# - URL (e.g., https://example.com/) -> opens the specified URL in WebApp
BOT_MINI_APP=false
# Hostname or domain of the Remnawave panel for connecting via external HTTPS.
# !!! Specify domain WITHOUT HTTP/HTTPS and WITHOUT trailing slash.
REMNAWAVE_HOST=panel.domain.com
# API token for authenticating with the Remnawave service.
REMNAWAVE_TOKEN=change_me
# Secret token for verifying incoming webhooks from Remnawave.
# In the Remnawave Panel, this corresponds to WEBHOOK_SECRET_HEADER (env).
REMNAWAVE_WEBHOOK_SECRET=change_me
# Password for the database.
DATABASE_PASSWORD=change_me # SHOULD ALREADY BE SET IN STEP 3
REMNAWAVE_HOST to your Remnawave panel domain. Example: REMNAWAVE_HOST=panel.domain.comREMNAWAVE_TOKEN variable to your panel API token. You can create a token in Remnawave Settings → API Tokens.REMNAWAVE_WEBHOOK_SECRET must match the value of WEBHOOK_SECRET_HEADER in the panel’s .env file.REMNAWAVE_COOKIE=rEmnaprx=aBCDefgh1. How to get the cookie: instructions.Step 5: Configure the webhook from the panel to the bot
Open the Remnawave panel .env file:
cd /opt/remnawave && nano .env
Set WEBHOOK_ENABLED=true and set WEBHOOK_URL to your actual bot domain:
WEBHOOK_ENABLED=true
WEBHOOK_URL=https://bot.domain.com/api/v1/remnawave
bot.domain.com with your actual domain.Find the WEBHOOK_SECRET_HEADER variable in the same file and copy its value:
WEBHOOK_SECRET_HEADER=ey1234567890qwertyuiopasdfghjklzxcvbnm
ey1234567890qwertyuiopasdfghjklzxcvbnm is shown as an example.Restart the Remnawave panel container to apply the changes:
cd /opt/remnawave && docker compose up -d
Return to the bot’s .env file and paste the copied value into REMNAWAVE_WEBHOOK_SECRET:
cd /opt/remnashop && nano .env
REMNAWAVE_WEBHOOK_SECRET=ey1234567890qwertyuiopasdfghjklzxcvbnm
REMNAWAVE_WEBHOOK_SECRET must match the value of WEBHOOK_SECRET_HEADER in the panel’s .env file.Step 6: Start the bot
docker compose up -d && docker compose logs -f -t
You can now proceed to set up the reverse proxy.