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 by Simen Daehlin, Community Star at Strapi.
If you would like an official v4 image, please share it on the roadmap .
The following documentation will guide you through the installation of a new Strapi project using Docker .
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 .
#Creating a Strapi project
Create an empty folder.
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.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 to build the image yourself.
✋ 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 to build the image yourself.
The following documentation will guide you through the one-click creation of a new Strapi project hosted on DigitalOcean
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 to create an account if you don't already have one.
#Creating a Strapi project
- Go to the Strapi page on DigitalOcean's marketplace.
- Click on Create Strapi Droplet button.
- Keep the selected "Shared CPU - Basic" plan.
- Choose "Regular Intel with SSD" as a CPU option.
- Select your virtual machine size (minimum of 2 GB/1 CPU).
- Choose a datacenter region (closest to you or your target area).
- Add a new SSH key. You can follow this guide .
- Give your virtual machine a hostname.
- 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:
- Go to the droplets list on DigitalOcean , logged in.
- Click on the droplet name that is used for your Strapi application.
- Copy the public ipv4 address of the droplet.
- 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 are most welcome.
✋ CAUTION
One-click installation guides are not updated by the Strapi documentation team anymore. Community contributions are most welcome.
The following documentation will guide you through the one-click creation of a new Strapi project hosted on Platform.sh .
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 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.
- In the Platform.sh website , click on the Add project button.
- Select the Use a template option.
- Fill the Project name and Region fields.
- Click on the Next button.
- Using the search bar, search for the
Strapi
template (see source code ). - Select the template. After a few seconds, your Strapi application should be setup with a PostgreSQL database.
#Running Strapi
To visit your Strapi application:
- Go to the Platform.sh website , logged in.
- Go to Settings > Domains.
- 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 are most welcome.
✋ CAUTION
One-click installation guides are not updated by the Strapi documentation team anymore. Community contributions are most welcome.
The following documentation will guide you through the one-click creation of a new Strapi project hosted on Render .
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 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 for more information), which differ based on the databased used and the storage location of uploaded media library files:
- Strapi with SQLite and uploads on disk
- Strapi with PostgreSQL and uploads on Cloudinary
- Strapi with PostgreSQL and uploads on disk
Once the choice between the 3 repositories is made:
- Fork the repository on GitHub.
- In the README file of your forked repository, click the Deploy on Render button.
- 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 documentation), Strapi must be running locally in development mode.
To run Strapi locally:
- Clone the forked repository to your local machine.
- Still in terminal, access the repository using the
cd <repository-name>
command. - 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 would also include a staging environment for testing.
Comments