Skip to main content

Deployment

Strapi provides many deployment options for your project or application. Your Strapi applications can be deployed on traditional hosting servers or your preferred hosting provider.

The following documentation covers how to develop locally with Strapi and deploy Strapi with several common hosting options.

☁️ Strapi Cloud

Don't want to deploy Strapi by yourself? Use Strapi Cloud to easily deploy and host your project.

🤓 Community Guides

In addition to the official deployment guides maintained by Strapi that are found here, community-maintained guides for additional providers are available in the Strapi Forum.

💡 Tip

If you already created a data structure with the Content-Type Builder and added some data through the Content Manager to your local (development) Strapi instance, you can leverage the data management system to transfer data from a Strapi instance to another one.

Another possible workflow is to first create the data structure locally, push your project to a git-based repository, deploy the changes to production, and only then add content to the production instance.

General guidelines

Hardware and software requirements

To provide the best possible environment for Strapi the following requirements apply to development (local) and staging and production workflows.

  • Node LTS (v14 or v16) Odd-number releases of Node are not supported (e.g. v13, v15).
  • NPM v6 (or the version shipped with the LTS Node versions)
  • Standard build tools for your OS (the build-essentials package on most Debian-based systems)
  • Hardware specifications for your server (CPU, RAM, storage):
HardwareRecommendedMinimum
CPU2+ cores1 core
Memory4GB+2GB
Disk32GB+8GB
  • A supported database version:
    DatabaseRecommendedMinimum
    MySQL8.05.7.8
    MariaDB10.610.3
    PostgreSQL14.011.0
    SQLite33
🤓 Database deployment

Deploying databases along with Strapi is covered in the databases guide.

  • A supported operating system:
Operating SystemRecommendedMinimum
Ubuntu (LTS)22.0420.04
Debian11.x10.x
CentOS/RHEL9.x8.x
macOS11.010.15
Windows Desktop1110
Windows Server20222019

Application Configuration

1. Configure

We recommend using environment variables to configure your application based on the environment, for example:

// Path: ./config/server.js

module.exports = ({ env }) => ({
host: env('APP_HOST', '0.0.0.0'),
port: env.int('NODE_PORT', 1337),
});

Then you can create a .env file or directly set environment variables in your chosen deployment platform:

APP_HOST=10.0.0.1
NODE_PORT=1338
💡 Tip

To learn more about configuration details, see the configurations documentation.

2. Launch the server

Before running your server in production you need to build your admin panel for production:

NODE_ENV=production yarn build

Run the server with the production settings:

NODE_ENV=production yarn start
Caution

We highly recommend using pm2 to manage your process.

If you need a server.js file to be able to run node server.js instead of npm run start then create a ./server.js file as follows:

path: ./server.js

const strapi = require('@strapi/strapi');
strapi(/* {...} */).start();
Caution

If you are developing a TypeScript-based project you must provide the distDir option to start the server. For more information, consult the TypeScript documentation.

Advanced configurations

If you want to host the administration on another server than the API, please take a look at this dedicated section.

Deployment Guides

Manual guides for deployment and optional software: