ARTICLE

Deploy Strapi on AWS/GCP/Digital Ocean using Porter

Trevor Shim
August 6, 2021
2 min read

Intro

Porter is a Platform as a Service (PaaS) that runs in your own cloud provider. It brings the convenience of platforms like Heroku, Netlify, or Vercel into a cloud provider of your choice. Under the hood, Porter runs on top of a Kubernetes cluster but abstracts away its complexity to the extent that you don't even have to know that it's running on Kubernetes.

This is a quick guide on how to deploy Strapi to a Kubernetes cluster in AWS/GCP/DO using Porter. This guide uses PostgresDB by default - to customize your database settings, modify the files in /app/config/env/production in the example repository.

Quick Deploy

1. Create an account on Porter.

2. One-click provision a Kubernetes cluster in a cloud provider of your choice, or connect an existing cluster if you have one already.

3. Fork this repository.

4. From the Launch tab, navigate to Web Service > Deploy from Git Repository. Then select the forked repository and click on Dockerfile in the root directory.

5. Configure the port to 1337 and set environment variable to NODE_ENV=production. Depending on your database settings, you might want to add more environment variables. More on this in the section below.

6. Set the assigned resources to Strapi's recommended settings (i.e. 2048Mi RAM, 1000 CPU), then hit deploy!

Screen Shot 2021-08-06 at 11.25.41 AM

Deploying PostgresDB

  1. Strapi instance deployed through Porter connects to a PostgresDB by default. You can connect Strapi instance deployed on Porter to any external database, but it is also possible to connect to a database that is deployed on Porter. Follow this guide to deploy a PostgresDB instance to your cluster in one click.
  2. After the database has been deployed, navigate to the Environment Variables tab of your deployed Strapi instance. Configure the following environment variables:

NODE_ENV=production DATABASE_HOST= DATABASE_PORT=5432 DATABASE_NAME= DATABASE_USERNAME= DATABASE_PASSWORD=

To determine what the correct environment variables are in order to connect to the deployed database, see this guide.

Development

To develop, clone the example repository to your local environment and run npm install && npm run develop; from the app directory. Porter will automatically handle CI/CD and propagate your changes to production on every push to the repository.

Questions?

Join the Porter Discord community if you have any questions or need help.

Porter is fully open source, check out the repository here!

Next Up

IaaS vs PaaS vs SaaS
Shankar Radhakrishnan
5 min read
Discover the Advantages of Platform-as-a-Service (PaaS)
Shankar Radhakrishnan
4 min read
Understanding Platform-as-a-Service (PaaS): what it is and how it works
Shankar Radhakrishnan
5 min read
How Tajir deploys over 10x faster with Porter
Justin Rhee
2 min read
How TyltGO powers same day delivery with Porter
Trevor Shim
3 min read
Migrating Postgres from Heroku to RDS
Rudi MK
8 min read
Should startups use Kubernetes?
Justin Rhee
4 min read
Why companies move off Heroku (besides the cost)
Justin Rhee
4 min read
Announcing the Heroku Migration Program
Trevor Shim
3 min read
History of PaaS: How Canon almost became a major cloud provider
Trevor Shim
6 min read
Deploy Strapi on AWS/GCP/Digital Ocean using Porter
Trevor Shim
2 min read
Our Journey Building Porter
Justin Rhee
3 min read
Guide: Updating Instance Type on AWS EKS
Justin Rhee
5 min read
Datadog on Kubernetes: Avoiding Common Pitfalls
Trevor Shim
5 min read
Deploy Django on Kubernetes in a few clicks (without even Dockerizing your application)
Trevor Shim
4 min read
Guide: Setting up a Tailscale VPN on Kubernetes
Justin Rhee
4 min read
Subscribe to our weekly newsletter
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.