Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

4. Hosting on the cloud (Heroku)

Tristan Chin edited this page Jul 16, 2022 · 2 revisions

Hosting on the cloud

If you prefer to have the server available at all times, you can spin it up on a hosted cloud provider. Here, I'll be showing you how to do it with Heroku and the Heroku CLI tool. This is not a Heroku tutorial, it is expected that you know the basics of Heroku, so I won't be going much in details.

Using Heroku

Navigate to a forked version of the repository and run the following commands.

1. Create a new Heroku app

heroku create

2. Add FFMPEG to your app

heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git

3. Push your code to Heroku

git push heroku master

Configure your database adapter

Depending on which adapter you're using for DB_ADAPTER, follow the following instructions.

File-system (fs)

The FS adapter uses the file-system of your Heroku app to store your database as a JSON file. This is the adapter used by default and requires no configuration. You're all set!

Redis (redis)

Appart from the fs adapter, redis is the most simple adapter to setup with Heroku. All you need to do is add the add-on and it will add Redis to your app and the REDIS_URL config var.

# Installs the free package of Heroku Redis
heroku addons:create heroku-redis:hobby-dev

MongoDB (mongo)

Using the MongoDB adapter is a bit more complicated than Redis. You can follow the article I used myself to setup MongoDB for this project.

When your database is setup, add the MONGO_URL config var to your Heroku app with your connection URI. Make sure your database is set to accept connections from anywhere, rather than a single IP. (Unless you know the IP of your Heroku instance)