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

Posted February 26, 2020 9.8k views

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.


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.

Submit an Answer
2 answers


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.

by Brennen Bearnes
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.

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