6 Top Deployment Options For Your Strapi Application
Tags: strapi, deploy, aws, azure
Published: 2022-11-14 11:33:57

**Author: Abdulwahab Ashimi**

If you are new to building with Strapi, you may wonder how to handle migration across all environments for development, production, and testing. This article will help you decide which platform will be best for deploying your production app.

## What is Strapi?

[Strapi is an open-source headless content management system (CMS)](https://strapi.io/) built to provide ease while developing APIs with different features and working with all frontend GraphQL enabled frameworks. With Strapi, you can create content types, handle users, and manage images and audio using the media library.


## Hosting your Strapi Application

You are required to host and communicate with your API on a live server. This article will focus on the different Strapi environments, what to consider before picking a deployment option, and their pros and cons.

### Strapi Environments

[Environment variables](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html) are provided to be used in Config files. Instead of writing the credentials across all config files, they are defined in a `.env` file to configure **development, production, and test** environments. 

Your project is in the Development environment when it is still being worked on locally. This is indicated in the structure and config; it is in the production environment once deployed. 

The state of your environment affects the availability of certain features like the content-type builder. [Watch this video to see how to migrate your content across environments.](https://www.youtube.com/watch?v=6RUZJuRxV5o)

## Most Popular Deployment Options

[Take complete control of your deployment](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment.html) and deploy on more robust platforms. Here is a list of the most popular recommendations and the advantages and limitations of some of these deployment options. That way, it’s easier to decide what works best for you. 

### Amazon AWS EC2:

Amazon AWS EC2 is a service offered as part of Amazon Web Services; it allows you to deploy your Strapi apps without worrying about how to scale or pay more than you utilize. [Find their pricing on their website](https://aws.amazon.com/ec2/pricing/).

The Elastic Computer Service allows you to decide the geographical location for your instance; this improves reliability and eliminates network delay. It also runs on multiple operating from Linux, Fedora, and Redhat to Windows.

You can [use the guide](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.html) for help when setting up.

**Advantages:**
- You have total control over your deployment and can manage any aspect of your production app.
- You can deploy your app in any region.
- You get to pay for only what you use.

**Disadvantages:**
- The deployment process is lengthy compared to others.
- Setting up your instance could be complicated.


### Azure:

Azure is powered by Microsoft and offers Compute Service that runs on Windows and Linux, on which you can deploy complex applications. You can start without cost and [pay on the go while scaling your application](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/). The deployment guide is available in the [documentation](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.html#paas-deployment-guides). 

**Advantages:**
- You have access to your production files and database and can manage them.
- You only pay based on your consumption
- Scalability is easier.

**Disadvantages:**
- The deployment process is lengthy and takes a while.
- You might require some knowledge of DevOps.


### DigitalOcean

Digital Ocean offers Linux-based virtualized hardware, which can either be independent or part of a more extensive infrastructure, and access to firewalls, with unlimited scalability. [Their pricing is flexible](https://www.digitalocean.com/pricing), and there is an extensive [guide on how to get started](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.html).

**Advantages:**
- Great server quality.
- Cheap and affordable pricing. 
- Flexibility and scalability: You can easily upgrade your infrastructure if your app grows.

**Disadvantages:**
- It takes time to set up the server.
- Lack of [CDN](https://www.cloudflare.com/learning/cdn/what-is-a-cdn/). 


### Heroku

[Heroku](https://www.heroku.com) is a cloud platform focused on applications and developer experience. They provide a secure, scalable database-as-a-service with constant threat monitoring and automatic operating system vulnerability patching. 

You can extend applications for use with Heroku with over 200 Add-ons available in [Heroku Elements Marketplace](https://elements.heroku.com/addons). There are different plans based on dyne hours per month; you can find [the pricing on their website](https://www.heroku.com/pricing). If this is the option for you, you can get started using the [deployment documentation](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.html#heroku-install-requirements). 

**Advantages:**
- **Easy Setup**: You can easily launch your Strapi App with Heroku without bothering about configuring the database.
- **Scalability**: You can purchase more dynos and size up your DB.
- Great plugin support for third-party apps.

**Disadvantages:**
- **Cost**: It is relatively more expensive than using an IaaS for the same level of performance.
- **Limited Access**: You cannot manage your deployment right from the server.
- **Deployment Issues**: Once you make a wrong push to the GitHub repository, Your deployment is equally affected.


### Platform.sh

The Platform.sh cloud allows developers to deploy their applications fast and worry less about scalability and database management. The main requirement is that you use Git to manage your application code. 

Managing your stack on Platform.sh gives you features like Unified Environment, Multi-Services & Multi-App, Full Cluster Cloning Technology, Fail-Proof Deployments, and more. The deployment process is completed within minutes, and there is no downtime, and you can find [the pricing](https://platform.sh/pricing/) on their website. 

**Advantages:** 
- It has good documentation and a detailed guide on deploying your apps.
- You can deploy at scale anywhere: If your apps grow bigger, You can easily scale your app.
- It includes a diverse library of development languages and frameworks. 

**Disadvantages:**
- **Limited access and control**: You do not have access to managing your production database and others. 
- **Deployment issues**: An accidental bad push to the repository can crash your production app.


### Render

Render is a cloud-based solution for building and running apps, websites, and CDNs with free TLS certificates. They have flexible [pricing](https://render.com/pricing) and offer database management with PostgreSQL. If you are considering this option, you can follow the deployment guide [here](https://render.com/docs/deploy-strapi).

**Advantages:**
- It is developer-friendly: It’s easy to use and requires just a few steps to deploy. 
- Free and automatic SSL is available.
- It provides daily database backups to prevent loss of data.

**Disadvantages:**
- It does not have simple shared hosting.


## Conclusion

Strapi is constantly evolving; ensuring your app is deployed without hassle is a priority. Strapi recently [announced Cloud beta](https://strp.cc/3UQUShw), and the stable is coming soon with fast CDN, security, automatic backup, multi-database support, unlimited usage, and easy scalability.

{% youtube p-OIqKWhHnw %}


[Join the waitlist](https://strp.cc/3TD6iV0) and while we await Strapi Cloud, leave a comment and share this article with other new Strapi users trying to decide on a deployment option.