# How to Host PostgreSQL for Free on PandaStack
Running your own PostgreSQL server means dealing with backups, updates, connection limits, and security patches. PandaStack's managed PostgreSQL removes all of that overhead — spin up a database in under a minute and connect to it from any application.
What PandaStack's Managed PostgreSQL Includes
- Automatic backups
- Monitoring and alerting
- Connection pooling
- SSL-encrypted connections
- Simple dashboard management
PandaStack also supports MySQL, Redis, and MongoDB if your stack requires them.
Step 1: Create a PostgreSQL Database
- 1Log in to [dashboard.pandastack.io](https://dashboard.pandastack.io)
- 2Click Databases in the left sidebar
- 3Click New Database
- 4Select PostgreSQL
- 5Choose your configuration and click Create
Your database is ready in about 60 seconds.
Step 2: Get Your Connection Details
After creation, click your database to see the connection details panel:
Host: db.pandastack.io
Port: 5432
Database: your_database_name
Username: your_username
Password: ****
SSL: requiredThe dashboard also shows you the full connection string:
postgresql://username:password@db.pandastack.io:5432/your_database_name?sslmode=requireStep 3: Connect via psql
psql "postgresql://username:password@db.pandastack.io:5432/your_database_name?sslmode=require"Or with individual parameters:
PGPASSWORD=yourpassword psql -h db.pandastack.io -U username -d your_database_name -p 5432Step 4: Connect from Your Application
Node.js (pg or postgres.js)
import postgres from 'postgres'
const sql = postgres(process.env.DATABASE_URL, {
ssl: 'require',
max: 10, // connection pool size
})
const result = await sql`SELECT NOW()`
console.log(result[0].now)Python (psycopg2 or asyncpg)
import psycopg2
conn = psycopg2.connect(os.environ['DATABASE_URL'], sslmode='require')Django
import dj_database_url
DATABASES = {
'default': dj_database_url.config(default=os.environ['DATABASE_URL'])
}Step 5: Set DATABASE_URL as an Environment Variable
In your PandaStack deployment settings, add:
DATABASE_URL=postgresql://username:password@db.pandastack.io:5432/your_database_name?sslmode=requireThis keeps your credentials out of your codebase and in PandaStack's encrypted environment variable store.
Step 6: Monitor Your Database
From the database dashboard you can:
- View connection count and query performance
- Set up alerts for high CPU or connection limits (email, Slack, or webhook)
- View backup history and trigger manual backups
- Check storage usage
Step 7: Connect Multiple Apps to One Database
A single managed PostgreSQL database can serve multiple applications. Each app connects using the same connection string. Use separate schemas or databases within the same PostgreSQL instance to keep data isolated.
Other Supported Database Types
PandaStack supports four database types from the same dashboard:
| Database | Use Case |
|---|---|
| PostgreSQL | General-purpose relational database |
| MySQL | Web apps, WordPress, legacy PHP |
| Redis | Caching, sessions, queues |
| MongoDB | Document storage, unstructured data |
Create each from Databases → New Database → select type.
Full documentation: [docs.pandastack.io](https://docs.pandastack.io).