# 21YunBox

✋ CAUTION

This third-party deployment guide might not be up-to-date with Strapi v4. Contributions (opens new window) are most welcome.

This guide explains how to update an existing Strapi project so it can be deployed on 21YunBox (opens new window).

21YunBox provides a Chinese CDN, continuous deployment, one-click HTTPS and other services such as managed databases and backend web services (opens new window), allowing to launch web projects in China.

With persistent disks and managed PostgreSQL databases, 21YunBox gives you multiple different ways to store your content. 21YunBox services come with fully managed SSL, so it's no longer necessary to set up a proxy server to secure your Strapi app. Since 21YunBox services are automatically restarted if they become unresponsive, you don't need to use a process manager like pm2 either.

💡 TIP

For more information consult 21YunBox's Deploy Strapi guide (opens new window).

PREREQUISITES

This guide assumes you already have a Strapi project to deploy. If you need a project, use the Quick Start to get started or fork 21YunBox's Strapi Examples:

# Setup

Follow the procedure below to set up a Strapi CMS on 21YunBox:

  1. Create a 21YunBox account. If you don't already have one, visit 21YunBox dashboard (opens new window).

  2. Create a new web service on 21YunBox, and give 21YunBox permission to access your GitHub or Gitee repo.

  3. Use the following values during creation:

    Setting Value
    Environment Node 12.19
    Build Command yarn && yarn build (or your own build command)
    Publish Directory rsync -a public/ /data/public/ && yarn start (or your own output directory)
  4. Add the following environment variables:

    Setting Value
    NODE_ENV production
    DATABASE_FILENAME If you use SQLite database, use /data/strapi.db
    DATABASE_URL If you use Postgres database, paste the database URL here (we have demo video below if you are unsure)
  5. Click the "Deploy" button.

That's it! Your site will be live on your 21YunBox URL (e.g. yoursite.21yunbox.com) as soon as the build is done.

# Continuous deploys

Now that 21YunBox is connected to your repo, it will automatically build and publish your site any time you push to Gitee or GitHub.

# Custom domains

Add your own domains to your site easily using 21YunBox's custom domains (opens new window) guide.