Directus: Connecting Directus to a PostgreSQL database
This documentation is part of the External databases guide. You can view the complete guide here: How to connect Directus to a MySQL, MariaDB, or PostgreSQL database.
👋 Welcome to the Stackhero documentation!
Stackhero offers a Directus cloud service, ready to use in production, in just 2 minutes:
- Unlimited collections, items, users, roles, API requests, and transfers
- Customizable domain name secured with HTTPS (for example, https://cms.your-company.com)
- Dedicated and unlimited email server included
- Redis cache server included for high performance
- Optimal performance and robust security powered by a private and dedicated VM.
- One-click updates for effortless maintenance
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Directus cloud solution!
-
Start by creating a user for Directus on PostgreSQL. Open PgAdmin, expand servers > postgresql, right-click on Login/Group Roles, and select Create > Login/Group Role....
-
In the Name field, enter
directus. -
Switch to the Definition tab and set a strong, secure password.
-
Next, go to the Privileges tab, check Can login, and save the new user.
Directus user creation on a PostgreSQL database -
Now create a database for Directus. Right-click on Databases and choose Create > Database.
-
Enter
directusin the Database field, selectdirectusas the owner, and save your changes.
Directus database creation on PostgreSQL -
Finally, navigate to your Stackhero dashboard, select your Directus service, and click Configure.
-
Under Database, select PostgreSQL and fill in the additional fields as shown below.
Configuration of PostgreSQL for Directus