Can I host a Strapi CMS and the front-end application on the same droplet?

Is it possible to host a Strapi CMS and the front-end application (also running on NodeJS) that consumes the Strapi API on the same droplet? Is it possible to use sub-domains to direct tot he 2 apps? e.g. for Strapi and just loads the public app?

I’m really a novice when it comes to hosting/deployment so appreciate any advice.



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Yes, this would not be a problem. What you would need keep in mind is:

  • Make sure that the Strapi and the Node.js applications are running on different ports, for example, start Strapi on port 1337 as suggested in the documentation.

  • You can take a look at the steps on how to install Strapi on a DigitalOcean Droplet here:

  • Then you can start Node.js on port 8080 for example.

  • Finally install Nginx and set it up as a reverse proxy for your Node.js application:

  • Also if needed you can create a second Nginx server block for your Strapi app and set the server_name to your subdomain name as you mentioned. The Nginx proxy rules that you would need to add for the Strapi application would be a bit different to the Node.js ones, you can use the following:
proxy_pass http://localhost:1337;  
proxy_http_version 1.1;  
proxy_set_header Upgrade $http_upgrade;  
proxy_set_header Connection 'upgrade';  
proxy_set_header Host $host;  
proxy_cache_bypass $http_upgrade; 

Hope that this helps! Let me know if you have any questions. Regards, Bobby

hello can you help me? I bought a droplet with strapi and I have error when I assign strapi to a subdomain when assigning my strapi to a subdomain first the login image disappears, I get a 404 not found error and when entering I get an error 405 in / admin / init. Help please I am hazing on strapi and hosting it in production in the vps