How to Properly Set Up Multiple Directus Environments (Dev, Sandbox, Prod) on Cloudron?
-
Hi Cloudron team and community,
I’m planning to deploy Directus on Cloudron and would like to structure it properly from the beginning with three isolated environments:
Development
Sandbox / UAT
Production
Since Directus uses internal system tables (directus_collections, directus_fields, directus_relations, etc.), I want to avoid schema conflicts or corruption when promoting changes between environments.
I’m aware that tools like pg_dump, Devart, or traditional SQL export don’t handle Directus metadata well, so I’m exploring directus schema snapshot / schema apply for schema promotion and version control.
Before I begin, I’d appreciate help with:
-
What’s the best way to set up three separate Directus instances (e.g., directus-dev.domain.com, directus-sandbox.domain.com, etc.) on a single Cloudron server?
-
Will I run into any issues running multiple Directus apps on the same box, each with their own PostgreSQL database?
-
Any best practices or gotchas for syncing schema and config across environments using CLI-based snapshots?
-
If needed later, can Directus apps on Cloudron be CI/CD integrated (e.g., via schema promotion scripts) without breaking Cloudron’s update flow?
I'm aiming for a clean, maintainable setup that supports Git-based schema tracking and safe production deployments. Any community-tested advice or examples would be very helpful.
Thanks in advance!
-
-
Hi Cloudron team and community,
I’m planning to deploy Directus on Cloudron and would like to structure it properly from the beginning with three isolated environments:
Development
Sandbox / UAT
Production
Since Directus uses internal system tables (directus_collections, directus_fields, directus_relations, etc.), I want to avoid schema conflicts or corruption when promoting changes between environments.
I’m aware that tools like pg_dump, Devart, or traditional SQL export don’t handle Directus metadata well, so I’m exploring directus schema snapshot / schema apply for schema promotion and version control.
Before I begin, I’d appreciate help with:
-
What’s the best way to set up three separate Directus instances (e.g., directus-dev.domain.com, directus-sandbox.domain.com, etc.) on a single Cloudron server?
-
Will I run into any issues running multiple Directus apps on the same box, each with their own PostgreSQL database?
-
Any best practices or gotchas for syncing schema and config across environments using CLI-based snapshots?
-
If needed later, can Directus apps on Cloudron be CI/CD integrated (e.g., via schema promotion scripts) without breaking Cloudron’s update flow?
I'm aiming for a clean, maintainable setup that supports Git-based schema tracking and safe production deployments. Any community-tested advice or examples would be very helpful.
Thanks in advance!
@DualOSWinWiz Absolutely no idea but please keep us updated!
-
-
Same here, I don't have much idea of Directus. For the Cloudron specific questions:
- Yes, you can just install 3 app instances of Directus
- I don't expect any issues. In fact, it's quite a common set up to have many app instances . As you said, each app has it's own PostgreSQL database, they won't mess wieth each other .
3 and 4 - I don't know the answer . But I would say if you can write up on how what you have in mind can be managed outside of Cloudron, we can help map it to Cloudron workflow.
-
The problem is managing the consistency as a pipeline methodology between environments like"development", "sandbox" and "production".
Where if all 3 apps are on same version how could i push code changes from dev to Production. Because of Metadata postgress to postgree sql migration even with a paid tool like Devarts PostgreSQL Studio failed
-
Hello @DualOSWinWiz
One Idea:
Since the
prod
instance is themaster
and has the highest priority of data, eachdev
/sandbox
orstage
could be a fresh clone from the latest app backup of themaster
.This way all other instances have the
master
data, and you can work with that data and direct cloned setup to confirm what you are planning to do works.
Then do the same on themaster
and all others will then have to re-deploy from the newmaster
. -
The problem is managing the consistency as a pipeline methodology between environments like"development", "sandbox" and "production".
Where if all 3 apps are on same version how could i push code changes from dev to Production. Because of Metadata postgress to postgree sql migration even with a paid tool like Devarts PostgreSQL Studio failed
@DualOSWinWiz said in How to Properly Set Up Multiple Directus Environments (Dev, Sandbox, Prod) on Cloudron?:
how could i push code changes from dev to Production
I'd try cloning from a backup of staging into production or something like that.
Or perhapa Syncyhing could somehow ne used?
️
-
Hello @DualOSWinWiz
One Idea:
Since the
prod
instance is themaster
and has the highest priority of data, eachdev
/sandbox
orstage
could be a fresh clone from the latest app backup of themaster
.This way all other instances have the
master
data, and you can work with that data and direct cloned setup to confirm what you are planning to do works.
Then do the same on themaster
and all others will then have to re-deploy from the newmaster
.@james, the problem is that, as you said, production will always have priority over data. Let's say I create a clone from production to work on a sprint. After one week of work, if all is good, the sandbox will be ready to be deployed on production. At that time, production will have new data. How to handle that? Because Directus on Cloudron only supports one database, it cannot be linked with another at that crucial time. CI/CD comes into play, which I am trying to figure out. 🤯 #Production #Data #Deployment #CI/CD #Database #Sandbox
-
@DualOSWinWiz said in How to Properly Set Up Multiple Directus Environments (Dev, Sandbox, Prod) on Cloudron?:
how could i push code changes from dev to Production
I'd try cloning from a backup of staging into production or something like that.
Or perhapa Syncyhing could somehow ne used?
️
@jdaviescoates i tried multiple things for synching and app start creating data integrity errors.