Configuration Setup of .env and Database
2 мин. чтения
After the server restarts, you need to configure the .env file and gain access to the database to ensure the bot operates correctly.
📝 Preparing the .env Configuration File #
The .env file contains all important parameters the bot uses to connect to external services and the database. Filling it out correctly is key to stable operation.
-
- Connect to the server via SSH (if not already connected):
ssh root@SERVER_IP_ADDRESSReplace
SERVER_IP_ADDRESSwith your actual server IP. - Navigate to the bot directory:
cd /MYBOTS/DEXBOT/Make sure you are in the bot folder — it should contain all necessary scripts.
- Find the config template and create the working
.envfile:mv .env.template .envThis creates the
.envfile from the template, which you need to fill in. - Open
.envin any text editor, for examplenanoorvim:nano .env - Fill in all the required fields:
- License Key: Your personal DEXBOT key to activate the bot.
- OKX API: Enter the API Key, Secret, and Passphrase for OKX services.
- Wallets: Addresses for Solana and EVM blockchains (e.g., Ethereum, Binance Smart Chain, etc.).
- Telegram Token and Admin ID: Your Telegram bot token and administrator ID for managing the bot.
- Database settings: Host, port, username, password, and database name you specified earlier during installation.
- Connect to the server via SSH (if not already connected):
After filling in, save the file and exit the editor (in nano: Ctrl+O → Enter → Ctrl+X).
- Important: be careful entering data — configuration errors may cause failures.
🔐 Accessing the Database via Adminer Web Interface #
After successful installation and server reboot, the database is ready to use. For easy management, use the Adminer web interface.
- Open your browser and go to:
http://SERVER_IP_ADDRESSReplace
SERVER_IP_ADDRESSwith your server’s IP address. - You will see the Adminer login page — a simple and lightweight database management tool.
- Enter the admin username and password you set during installation.
- After login, you can browse tables, make backups, run queries, and monitor database operations.
🔧 Security and Maintenance Recommendations #
- Never share or expose the
.envfile to third parties — it contains confidential data. - Regularly back up your database, especially before major changes.
- If you modify the
.envfile, restart the bot afterward to apply the new settings. - Use Adminer only from a secure network to prevent unauthorized access.
- Keep your server and database software updated to protect against vulnerabilities.