Skip to content

Heroku Setup

Robert Konigsberg edited this page Sep 25, 2020 · 5 revisions

To install and run

  1. Install git on Terminal
  2. Sign up for a free Heroku account
  3. Install Heroku CLI on your Terminal
  4. cd to the location where you want to put the TM web app folder
  5. git clone https://github.com/bafolts/terraforming-mars.git
  6. cd terraforming-mars
  7. heroku login
  8. Enter your Heroku credentials
  9. heroku create [app name] ([app name] is whatever you want to call your server. The server will eventually be [app name].herokuapp.com, and the git repo will be https://git.heroku.com/[app name].git.)
  10. git push heroku master

(If you want to push from another branch, use branch:master ref)

To update

  1. cd to the inside of terraforming-mars folder
  2. git pull
  3. git push heroku master

About https

By default Heroku's apps use the http protocol, and that's probably not good if you plan to share the link. Follow the instructions at on README.md to set up https.

To set up a database for game seeds

The free Heroku server falls asleep after 20-30 minutes of inactivity. You can set up a database to contain seeds from previously played games. Without setting this up, the seeds will be wiped after Heroku server goes to sleep. This instruction is from 13and3.

  1. Go to your Heroku dashboard
  2. Click on your TM server app
  3. Configure Add-ons
  4. In the add-ons search box, type "Heroku Postgres" and select it. Plan name: [Hobby Dev - Free]. Provision to add it to the server.
  5. Go to Settings
  6. Reveal Config Vars
  7. Copy the text postgres://... from the text field next to DATABASE_URL to the one below next to POSTGRES_HOST.

Screenshots:

Click "Configure Add-ons" from the Heroku app running your TM server

https://imgur.com/a/zKJgNHO

Search for and select Heroku Postgres

https://imgur.com/a/zKJgNHO

Go to Settings of your app

https://imgur.com/a/zKJgNHO

Click "Reveal Config Vars"

https://imgur.com/a/zKJgNHO

Copy the line next to DATABASE URL to the line below next POSTGRES_HOST

https://imgur.com/a/zKJgNHO