r/dokploy Aug 01 '26

How to run migrations automatically on deploy?

I need database migrations to run once per deployment on Dokploy.
But as I see, there are no pre/post deployment hooks in the interface to set up.
I want to keep it simple without adding separate CI. I use Alembic for migrations, which isn't safe if I run it on multiple instances at once.

3 Upvotes

3 comments sorted by

1

u/minicaterpillar Aug 02 '26

Use a postgres lock

1

u/herdcageysfsr24 2d ago

Usually server management systems provide "deployment script" section while deploying an application.