What options do you have for deploying a frontend-only React app to production?
Published: 2018-05-18 18:02:31

---
title: What options do you have for deploying a frontend-only React app to production?
published: true
tags: 
canonical_url: https://jsramblings.com/2018/05/12/options-for-deploying-react-to-production.html
---

If you’ve ever wondered **how to deploy** your React app once it’s ready, you probably know that figuring this out can become **confusing really fast**.

Most articles go over detailed instructions on how to configure nginx, how to configure reverse proxies. But do you really need any of these if you just have a **frontend-only React app** and are looking for the easiest way to deploy?

If you think about it, once you build a React app for production, you’re basically left with a bunch of `html`, `js` and maybe image files. This means you can deploy it to **any hosting that supports static file hosting**.

Let’s go over some of the options!

## Firebase

[Website](https://firebase.google.com/docs/hosting/) | [How to](https://dev.to/sathish/deploying-my-first-react-web-app-to-firebase---36bd)

Firebase is a Google service that also offers static site hosting. It comes with a free tier you can start with, deployments are done with their CLI and they support SSL, CDN & custom domains out of the box.

## Netlify

[Website](https://www.netlify.com/) | [How to](https://www.slightedgecoder.com/2017/12/09/deploying-existing-create-react-app-github-netlify/)

Gained a lot of traction recently. It’s a point and click interface that is very powerful, allowing you to configure automatic deployments based on a specific branch, to have ‘test’ deploys for feature branches and even do A/B testing of your website all from their UI.

## Surge.sh

[Website](https://surge.sh/) | [How to](https://dev.to/dceddia/deploy-create-react-app-with-surge-coc-temp-slug-7041928)

Surge is also a static site hosting service specifically targeteted at frontend developers. Supports custom domains, even with the free plan.

## Zeit Now

[Website](https://zeit.co/now) | [How to](https://zeit.co/docs/examples/create-react-app)

Deploy your website made as easy as running `now` in a folder. Supports a lot of options through their CLI. Also a great choice for deploying `node` apps or  or server-side rendered React apps.

## Github Pages

[Website](https://pages.github.com/) | [How to](https://itnext.io/so-you-want-to-host-your-single-age-react-app-on-github-pages-a826ab01e48)

This is a classic and probably the first choice if you just want a hosting for your library’s main page. Can be used for other stuff as well though since it has great integration with git and more.

Since it’s not explicitly targeting SPAs, you might run into issues when setting up the routes.

## AWS S3 buckets

[Website](https://aws.amazon.com/s3/)  &#124; [How to](https://www.fullstackreact.com/articles/deploying-a-react-app-to-s3/)

This is the most complex of the options described so far, however comes with greater flexibility and might come in handy if you already use AWS for other things. Use it together with AWS CloudFront and AWS Route 53 for a full Amazon solution ([described here](https://aws.amazon.com/blogs/mobile/deploy-a-react-app-to-s3-and-cloudfront-with-aws-mobile-hub/)). 

## Heroku, Digital Ocean, Azure or Amazon EC2

You can always deploy your app to a custom server instance. This requires tweaking with the server, but gives you more control. You will need to install and configure a web server on the machine - either nginx, apache, IIS or whatever you’re more comfortable with - and point it to serve your static files.

Though it’s tempting to use a custom setup if you already have a machine available that you’ve used for other projects, I highly recommend you try one of the options above to take your workflow to the next level :)