PostgreSQL, MongoDB, FerretDB and Valkey: connect and manage

Your own free PostgreSQL 17, MongoDB 8, FerretDB or Valkey server on Torchlite: connection strings, psql, mongosh or Compass, redis-cli, and how they differ.

5 min readBy Torchlite teamUpdated

PostgreSQL, MongoDB, FerretDB and Valkey: connect and manage
On this page

The Database plan runs one engine on a server of your own. There are five: MySQL (MariaDB), PostgreSQL 17, MongoDB 8, MongoDB-compatible (FerretDB) and Redis-compatible (Valkey). This guide covers all of them except MySQL, which has its own guide. For MySQL, read your own MySQL server with phpMyAdmin. The plan overview is on the database hosting page.

The connection has no TLS, so the password and your data travel unencrypted. Use these servers for game servers, bots and hobby projects, not for sensitive personal data.

What every engine has in common

  • Create it: on Create your server pick the Database plan and an engine, confirm your email, then press Start in the Console.
  • Address: the panel shows data.torchlite.host:<port>, with a port between 17000 and 17499. The examples here use data.torchlite.host:17023. Use your own values.
  • Password: under Startup, the variable Password holds the admin password (12 to 64 letters and digits). User shows the account name and cannot be changed. To change the password, edit it there and restart.
  • Console: it only shows the log and one line saying "is ready on port". Typing does nothing except stop. Use a database client.
  • Renew: every 48 hours, and the button opens 12 hours early. A server that is not renewed stops, and its files are kept.

In the examples, replace PASSWORD with your password. It only has letters and digits, so it needs no escaping in a connection string.

PostgreSQL 17

The admin user is admin. It can create databases and roles but is not a superuser. The first database is main. Logins use a password (scram-sha-256).

Connection string:

text
postgresql://admin:PASSWORD@data.torchlite.host:17023/main

With the psql client on your computer:

bash
psql "postgresql://admin:PASSWORD@data.torchlite.host:17023/main"

Then create a database and a role for an app:

sql
CREATE DATABASE app;
CREATE ROLE appuser LOGIN PASSWORD 'a-long-password';
GRANT ALL PRIVILEGES ON DATABASE app TO appuser;

Settings live in postgres/postgresql.conf in the server's files. Torchlite adds shared_buffers = 96MB and max_connections = 40, and they are yours to change. Restart after an edit.

MongoDB 8

This is real MongoDB 8. The admin user is admin with the root role, and the authentication database is admin. Leave out authSource=admin and the login fails.

Connection string:

text
mongodb://admin:PASSWORD@data.torchlite.host:17023/?authSource=admin

With mongosh:

bash
mongosh "mongodb://admin:PASSWORD@data.torchlite.host:17023/?authSource=admin"

With MongoDB Compass, paste the same connection string into the connection field and connect. MongoDB creates a database the first time you write to it, so there is no first database to look for.

Two things are different here. The plan has 1.25 GB of RAM for MongoDB, against 768 MB for the other engines, and MongoDB's cache is kept small to fit. The log is the file logs/mongod.log in the server's files, not the Console. Starting takes a little longer than the others, because the password is applied first.

MongoDB-compatible (FerretDB)

FerretDB is an open-source (Apache 2.0) server that speaks the MongoDB protocol and stores your data in PostgreSQL. The usual drivers and tools work with it: the Node mongodb driver, Mongoose, PyMongo, mongosh and MongoDB Compass. The plan has 1.25 GB of RAM, like MongoDB.

The admin user is admin and the authentication database is admin. The connection string has the same form as for MongoDB:

text
mongodb://admin:PASSWORD@data.torchlite.host:17023/?authSource=admin

With mongosh:

bash
mongosh "mongodb://admin:PASSWORD@data.torchlite.host:17023/?authSource=admin"

It is not MongoDB, and the limits are real:

  • No multi-document transactions.
  • No change streams.
  • No $where.
  • No per-user permissions: every database user sees every database on the server.
  • It reports itself as MongoDB 7.0.

It suits small apps and Discord bots. Choose real MongoDB if you need transactions or change streams.

Redis-compatible (Valkey)

This server is Valkey, a BSD-licensed server that speaks the Redis protocol. Existing Redis clients, commands, connection strings and libraries such as ioredis or redis-py work unchanged. INFO reports redis_version:7.2.4 and valkey_version:9.1.4.

The user is default and a password is always required.

Connection string:

text
redis://default:PASSWORD@data.torchlite.host:17023

With redis-cli:

bash
redis-cli -h data.torchlite.host -p 17023 --user default --pass PASSWORD

Then try it:

text
SET greeting hello
GET greeting

The server keeps up to 384 MB of data in memory, half the plan's RAM. It saves to disk with an append-only file and snapshots, so data survives a restart. When the memory is full, writes are refused and old keys are not deleted. Free some space by deleting keys, or use a smaller data set. Module loading and the DEBUG command are switched off.

It holds everything in memory, so it fits a cache, a queue or a leaderboard better than a large data set.

Backups

Backups from the panel copy the files, so make them while the server is stopped. You can also run the engine's dump tool from your computer while it runs:

bash
pg_dump "postgresql://admin:PASSWORD@data.torchlite.host:17023/main" > main.sql
mongodump --uri "mongodb://admin:PASSWORD@data.torchlite.host:17023/?authSource=admin"

For FerretDB, a panel backup of the stopped server is the safe choice.

For Redis, stop the server and take a panel backup. A reinstall keeps the data. See the backups guide.

Common problems

Typing in the Console does nothing

That is how it works for every engine. The Console is a log. Connect with a client.

Authentication failed

The password is wrong, or you left it out. A login without a password is refused as well. Copy the password again from Startup. After changing it there, restart the server.

MongoDB or FerretDB says authentication failed with the right password

Add ?authSource=admin to the connection string, or choose admin as the authentication database in Compass.

Connection refused or timed out

Check that the server is running and that the port matches the panel. A server that ran out of renew time is stopped: press Renew, then Start. For MongoDB, wait a little longer after Start.

The Redis-compatible server says OOM when writing

The 384 MB of memory is full. Delete keys and try again.

The server does not start after I edited postgresql.conf

A wrong line in postgres/postgresql.conf is the usual cause. The Console shows the log. Fix the line and press Start.

Start refuses my password

It must be 12 to 64 letters and digits, with no symbols or spaces.

Can I switch engine?

Yes, with Change engine in the panel. The old engine's data is deleted, not converted, so export it first.

Stuck on a step?

Ask on the forum. Your question links back to this guide, so whoever answers knows where you are.

Ask about this guide

About the author

Torchlite team

The people who run Torchlite

We build and run the Torchlite panel and the nodes. Every guide is checked on our own servers before it goes up, and updated when the panel changes.

Found a mistake? Tell us on Discord

Related guides

All guides →