Strapi Installing using Docker , DigitalOcean , Platform.sh And Render






Installing using Docker

✋ CAUTION

This Docker image is only for Strapi v3. For now, Strapi will not update the image for v4. However, to build an image compatible with Strapi v4, we recommend following this guide (opens new window)by Simen Daehlin, Community Star at Strapi.

If you would like an official v4 image, please share it on the roadmap (opens new window).

The following documentation will guide you through the installation of a new Strapi project using Docker (opens new window).

Docker is an open platform that allows to develop, ship and run applications by using containers (i.e. packages containing all the parts an application needs to function, such as libraries and dependencies).

✏️ NOTE

You can find the official Docker image for Strapi in the Docker Hub (opens new window).

#Creating a Strapi project

  1. Create an empty folder.

  2. In your empty folder, create a docker-compose.yaml file. It is where the new Strapi project will be created, and it defines the database and Strapi service to use.

    version: '3'
    services:
      strapi:
        image: strapi/strapi
        volumes:
          - ./app:/srv/app
        ports:
          - '1337:1337'
    
    Copied to clipboard!
  3. Pull the latest images using the following command:

    docker-compose pull
    
    Copied to clipboard!

#

Running Strapi

To run your Strapi project created with Docker, use one of the following commands:

# Execute Docker image detaching the terminal
docker-compose up -d

# Execute Docker image without detaching the terminal
docker-compose up

DigitalOcean One-click

✋ CAUTION

The one-click install droplet is currently missing from DigitalOcean's marketplace. We are not planning to continue support for this installation method but if you want to configure it yourself you can use our one-click repo (opens new window)to build the image yourself.

The following documentation will guide you through the one-click creation of a new Strapi project hosted on DigitalOcean(opens new window)

DigitalOcean is a cloud platform that helps to deploy and scale applications by offering an Infrastructure as a Service (IaaS) platform for developers.

PREREQUISITES

A DigitalOcean account is necessary to follow this installation guide. Please visit the DigitalOcean website (opens new window)to create an account if you don't already have one.

#Creating a Strapi project

  1. Go to the Strapi page on DigitalOcean's marketplace.
  2. Click on Create Strapi Droplet button.
  3. Keep the selected "Shared CPU - Basic" plan.
  4. Choose "Regular Intel with SSD" as a CPU option.
  5. Select your virtual machine size (minimum of 2 GB/1 CPU).
  6. Choose a datacenter region (closest to you or your target area).
  7. Add a new SSH key. You can follow this guide (opens new window).
  8. Give your virtual machine a hostname.
  9. Click Create Droplet. It may take from 30 seconds to a few minutes for the droplet to start, and a few minutes more to finish the Strapi installation.

#Running Strapi

Your Strapi application on DigitalOcean will be running in development mode. It is not recommended to use the application directly in production.

To visit your Strapi application:

  1. Go to the droplets list on DigitalOcean (opens new window), logged in.
  2. Click on the droplet name that is used for your Strapi application.
  3. Copy the public ipv4 address of the droplet.
  4. Use this address to access the Strapi application.

Visiting the Strapi application page for the first time will require to create the first administrator user.

Platform.sh One-Click

✋ CAUTION

One-click installation guides are not updated by the Strapi documentation team anymore. Community contributions (opens new window)are most welcome.

The following documentation will guide you through the one-click creation of a new Strapi project hosted on Platform.sh (opens new window).

Platform.sh is a Platform as a Service (PaaS) that allows the management of multiple websites and applications. In particular, it allows to quickly install and deploy a Strapi application.

PREREQUISITES

A Platform.sh account is necessary to follow this installation guide. Please visit the Platform.sh website (opens new window)to create an account if you don't already have one.

#Creating a Strapi project

There are 2 ways to create a new project hosted on Platform.sh: either by clicking the One-Click button, or following the numbered steps right below the button.

Deploy on Platform.sh

  1. In the Platform.sh website (opens new window), click on the Add project button.
  2. Select the Use a template option.
  3. Fill the Project name and Region fields.
  4. Click on the Next button.
  5. Using the search bar, search for the Strapi template (see source code (opens new window)).
  6. Select the template. After a few seconds, your Strapi application should be setup with a PostgreSQL database.

#Running Strapi

To visit your Strapi application:

  1. Go to the Platform.sh website (opens new window), logged in.
  2. Go to Settings > Domains.
  3. Click on the Platform.sh domain name that is used for your Strapi application.

Render One-Click

✋ CAUTION

One-click installation guides are not updated by the Strapi documentation team anymore. Community contributions (opens new window)are most welcome.

The following documentation will guide you through the one-click creation of a new Strapi project hosted on Render (opens new window).

Render is a cloud provider with persistent disks and managed PostgreSQL databases, that offers multiple different ways to store content.

PREREQUISITES

A Render account is necessary to follow this installation guide. Please visit the Render dashboard (opens new window)to create an account if you do not already have one.

#Creating a Strapi project

Render maintains 3 "Strapi on Render" example repositories (see Render's Deploy Strapi guide (opens new window)for more information), which differ based on the databased used and the storage location of uploaded media library files:

Once the choice between the 3 repositories is made:

  1. Fork the repository on GitHub.
  2. In the README file of your forked repository, click the Deploy on Render button.
  3. Make sure you granted Render the permission to access your forked repository.

✏️ NOTE

When using Cloudinary, you will be prompted to enter your account credentials as environment variables. Render encrypts environment variables and stores them securely.

#Running Strapi

Your Strapi application on Render will be running in production mode, with NODE_ENV=production. However, to add or edit content-types via the admin panel (see Content-type Builder (opens new window)documentation), Strapi must be running locally in development mode.

To run Strapi locally:

  1. Clone the forked repository to your local machine.
  2. Still in terminal, access the repository using the cd <repository-name> command.
  3. Run the yarn install && yarn develop command to run your Strapi project.

When committing changes and pushing them to your remote repository, Render will automatically deploy these changes to your production application. A typical workflow (opens new window)would also include a staging environment for testing.



Buy me a coffee

Back to top