Set Up PostgreSQL for Bearcat
Follow this guide if you choose PostgreSQL in the Desktop app or Windows service. The default SQLite setup needs no database server.
For Docker, docker-compose.postgres.yml starts PostgreSQL in its own container. See Run Bearcat in Docker.
Use PostgreSQL 18. Older PostgreSQL versions are currently untested.
Recommended Settings
Section titled “Recommended Settings”Use these connection settings in Bearcat:
Choose your own password. If you change any other values, enter them in Bearcat too.
PostgreSQL In Docker
Section titled “PostgreSQL In Docker”On Windows, Docker is the recommended way to run PostgreSQL. Bearcat can still run as the Desktop app or Windows service.
Create a folder for the database:
This is the database folder. Include it in your backups.
Start PostgreSQL 18:
On Windows PowerShell, use a Windows path instead:
Enter the connection settings above in Bearcat, using the password you chose for the container.
To stop the database:
To start it again later:
Stop the container before copying the data folder for a backup. Deleting this folder deletes the Bearcat database.
Windows
Section titled “Windows”As an alternative to Docker, install PostgreSQL as a Windows service:
Native installer
Section titled “Native installer”Download the PostgreSQL 18 Windows installer from postgresql.org/download/windows.
During installation:
- Choose PostgreSQL 18.
- Keep the default port
5432unless it is already used. - Set a password for the
postgressuperuser created by the installer. - Stack Builder is optional and not required by Bearcat.
Choose the account Bearcat should use:
- Installer account: Enter
postgresand the password you chose during installation in Bearcat. This uses the PostgreSQL superuser. - Separate account: Open pgAdmin 4, connect as
postgres, and create a login role namedbearcat. Set a password and enable Can create databases? Then enter this account in Bearcat.
Set the database name to bearcat. Bearcat creates it and applies migrations on first start.
Download Postgres.app from postgresapp.com.
Install and start Postgres.app, then create or start a PostgreSQL 18 server. Keep the default port 5432 unless it is already used.
Use Postgres.app’s psql command in a terminal. If your shell cannot find it, follow the
Postgres.app instructions to add its command line tools to PATH or use the full path.
Create an account with permission to create the database:
To create the database manually instead:
Then enter the connection settings in Bearcat.
Troubleshooting
Section titled “Troubleshooting”If Bearcat cannot connect:
- Check that PostgreSQL is running.
- Check that the port in Bearcat matches the PostgreSQL port (default:
5432). - Check that the username and password match.
- If the database does not exist, either grant the user
CREATEDBpermission or create the database manually.
