Connect to your database service (MongoDB, SQL, Redis)
Use the host and port shown in the Game Panel with the admin username and password you chose at checkout. Connection strings for MongoDB, MariaDB, PostgreSQL and Redis.
- Difficulty:
- Intermediate
- Time:
- 10 minutes
On this page
To connect to an Endercloud database service you need four things: the host, the port, and the admin username and password you chose at checkout. Put them into the connection string format for your database type, shown below.
What you chose at checkout
Database services are hosted in India and billed monthly or annually. The base price is ₹50/month (₹600/year), and every order also needs a Database Memory and a Database storage option. For example, 1 GB memory (+₹15) and 5 GB storage (+₹25) make ₹90/month. The Order Summary at checkout always shows your real total.
MongoDB: checkout offers MongoDB 8 (you can change the version later) and asks for a Database Name, a Mongo Admin Username and a Mongo Admin Password. These are the details you connect with.
SQL: you choose MariaDB or PostgreSQL.
Redis is also available.
Step 1: Find the host and port
Log in to the billing panel, open Services and click your database service.
Under Service Actions, click Auto Login to Panel (or Access Panel) to open it in the Game Panel.
The header shows the address, for example
in6.endercloud.in:45568. The part before the colon is the host; the number after it is the port. The Dashboard page shows the same details.Make sure the database is Online. Click Start if it is stopped.
Step 2: Use your admin username and password
These are the credentials you typed at checkout. Your database appears as a server in the Game Panel, just like a bot, so you can check or change them in its Startup tab. After changing them, Restart the database and update your app or bot. If anything is unclear, open a ticket.
If your password contains special characters such as @, :, /, # or %, they must be URL-encoded inside a connection string (for example @ becomes %40). Otherwise the string is read wrongly and login fails.
Step 3: Build your connection string
Replace USER, PASSWORD, HOST and PORT with your own values.
MongoDB
mongodb://USER:PASSWORD@HOST:PORT/?authSource=adminTo use the database you named at checkout, add its name after the port: mongodb://USER:PASSWORD@HOST:PORT/mydb?authSource=admin. The authSource=admin part tells MongoDB where the admin user is stored; without it you often get "Authentication failed". In MongoDB Compass, paste the same string into the connection box.
MariaDB
MariaDB works with MySQL drivers and tools, so most libraries accept a MySQL-style string:
mysql://USER:PASSWORD@HOST:PORT/DATABASEFrom a terminal (the mariadb or mysql client):
mysql -h HOST -P PORT -u USER -pNote the capital -P for the port. In tools like HeidiSQL or DBeaver, fill in host, port, user and password in separate fields.
PostgreSQL
postgresql://USER:PASSWORD@HOST:PORT/DATABASEFrom a terminal:
psql -h HOST -p PORT -U USER -d DATABASEEvery PostgreSQL server has a default database called postgres that you can connect to first, then create your own.
Redis
redis://:PASSWORD@HOST:PORTIf your Redis login uses a username as well, put it before the colon: redis://USER:PASSWORD@HOST:PORT. From a terminal:
redis-cli -h HOST -p PORT -a PASSWORDThen type PING. A reply of PONG means you are connected.
Keep it secure
Use a long, unique password with letters, numbers and symbols. Your database can be reached over the internet, so a weak password is a real risk.
Store the connection string in a
.envfile, never in public code or screenshots. See Keep your bot token safe with environment variables.Take regular backups from Backups and download important ones. See How to create and restore backups.
If you need to limit which IP addresses can connect, open a ticket and our team will tell you what's possible for your service.
Troubleshooting
Error | What to check |
|---|---|
Connection refused / timed out | The database is offline, or the host or port is wrong. Check the panel header. |
Authentication failed / Access denied | Wrong username or password, special characters not URL-encoded, or (MongoDB) |
SSL or TLS errors | Your client is forcing an encrypted connection. Try with SSL/TLS turned off, or open a ticket to ask what your service supports. |
Frequently asked questions
Is this the same as the Databases tab on my Minecraft server?
No. Game servers include free MySQL databases for plugins, created from the server's Databases tab. See How to create a MySQL database. A database service is a separate product with its own resources.
Can my bot on Endercloud use this database?
Yes. Use the same host, port and credentials in your bot's .env file.
Can I use localhost as the host?
No. Your database runs as its own service, so always use the host and port from the panel.
Was this article helpful?
Related articles
In Settings you can reinstall your server, switch its type with Change Egg (for example Paper to Vanilla Bedrock, or Node.js to Python), rename it, and find the Node and Server ID.
Upload your bot files with a requirements.txt, set your main .py file and Python version in the Startup tab, then click Start and check the console.
Most bots go offline because the code crashes, runs out of memory, uses an invalid token or missing intents, hits Discord rate limits, or the service is suspended for an unpaid invoice.
No domain? Open your website, API or bot dashboard over HTTPS with a free SSL certificate from Endercloud. Port first, a dash, then your node name, always on ender.co.in, like https://25808-agni.ender.co.in.
