Connect to your database remotely
Retrieve host, port and credentials, then authorize your client IP in the panel.
Connect to your database remotely
Your onesubnet.com databases are reachable from the outside over a network connection. Connecting requires the correct credentials and authorization of your client IP.
Cause / The problem
A “Connection refused” or “timeout” error during connection usually comes from an unauthorized client IP, a closed port, or incorrect credentials.
Solution
- Retrieve the connection parameters in the panel (Settings or Overview tab):
- Host: the server address (e.g.
db-paris.onesubnet.comor an IP). - Port depending on the engine:
- MariaDB / MySQL:
3306 - PostgreSQL:
5432 - MongoDB:
27017 - Redis:
6379
- MariaDB / MySQL:
- Username and password: created at initialization.
- Database name: usually that of the default user.
- Host: the server address (e.g.
- Authorize your client IP. For security, the database only accepts explicitly whitelisted IPs. In the panel, add your public IP (visible on ifconfig.me) to the Allowed IPs or Remote hosts list.
- Test the connection from the command line:
# PostgreSQL psql -h db-paris.onesubnet.com -p 5432 -U user -d mydb # MariaDB / MySQL mysql -h db-paris.onesubnet.com -P 3306 -u user -p mydb # MongoDB mongosh "mongodb://user:password@db-paris.onesubnet.com:27017/mydb" # Redis redis-cli -h db-paris.onesubnet.com -p 6379 -a password - Use a connection string in your application. PostgreSQL example:
postgresql://user:password@db-paris.onesubnet.com:5432/mydb?sslmode=require - Enable TLS/SSL if possible (
sslmode=requireon the PostgreSQL side,tls=trueon the MongoDB side) to encrypt traffic in transit. - If the error persists, check:
- That your IP has not changed (ISP with dynamic IP: use a dynamic DNS or authorize a range).
- That the port is not blocked by your own firewall / ISP router.
- That the user has rights on the database (
GRANT ALL ON mydb.* TO user).
For production, prefer connecting your application and the database on the same internal onesubnet network to reduce latency.