How do you properly deploy your strapi?

System Information
  • Strapi Version: 4.20
  • Operating System: ubuntu
  • Database: mysql
  • Node Version: node:18-alpine
  • NPM Version:
  • Yarn Version:

Hey all!

I am working with strapi and gatsby combination since a few month now. But I still have some issues organizing strapi in general.

What I do right now:

  • I push my project to gitlab when doing changes.
    So basically, when I create a new component in strapi, I test it with some content and then push it when I am certain it works.
  • The gitlab CI then triggers a script that basically pulls the latest commit on my server. The script then starts building strapi in a docker. The mysql database is running permanently with the content I have on the remote server of course.

The issues I have:

  • When I create a component locally, then push the project with the new components - which schemas are in json files in strapi - I have sometimes trouble seeing these components on the remote server. It feels like that when creating a component, strapi not only creates json files as schemas but also some database entry which is then missing on the remote server.

I would like to know how you guys solve this issue. Since I kept exporting my local database to import it on the remote server manually, every time I make a new commit, it was working for me. But now we want to go live soon and I am afraid I cant get all the created content deleted with exporting and importing my local database. Makes sense. The database should actually not even be the bottleneck of strapi working properly.

What am I missing here?
I am “still” at 4.20 and afraid of updating since strapi seems to have MANY issues regarding the database. One issue I have rn is that my API completely broke after I created a component locally which I then tested and after that deleted the component.

Now the API is not working anymore because strapi seem to miss this component which I dont have anymore… So basically, there is some trash in the database and I dont have any idea of the database and even where to look for what…

However. Whats your setup? How do you create components locally and push it on your server?

Thanks in advance

So really no one?

What’s the exact issue you’re having when deploying?
Any specific error?

Its basically all in the post:
I want to know what the default setup looks like. So you tell me: How does you dev and prod setup look like? How do you create components in dev, test them, and deploy your strapi? Do you also copy all the test data from the database? If no, how do your components work?

My components wont work without them having content. I dont understand how strapi is supposed to work.

Looks very empty here. Still having trouble. I still dont know how strapi is supposed to work when deploying from dev to prod when all components created in dev needs their counterparts in the database. This is not normal.Anyways… can be closed.

Hey @Baris just saw your message, what exact issue are you having? You care welcome to stop by Strapi Open Office hours and share your screen with your issue, we would love to help you.

Typically, when you create or add new collection types or components and redeploy, you will have access to those items, since it is based on the schema generated.

You should not mix your dev database with prod, that is not good practice. Stop on by Discord open office hours that way you can show us the issue you are having.

Or feel free to share some screen shots here.

Morning Session

Join us at 4 AM CST (9:00 AM GMT) for our new early bird session. Perfect for our global community members!

Afternoon Session

Don’t forget our regular session at 12:30 PM CST (6:30 PM GMT). A great time for an afternoon break and chat!