Skip to content

Deploy on Heroku

Heroku is a well-established PaaS that makes deploying TrocOS straightforward. It handles PostgreSQL, SSL, and deployments from your Git repository.

1. Create your app

Sign up at heroku.com and create a new application from the dashboard or the CLI:

sh
heroku create trocos

2. Set buildpacks

TrocOS needs both Node.js (for CSS compilation) and Ruby buildpacks. Node.js must come first:

sh
heroku buildpacks:add --index 1 heroku/nodejs --app trocos
heroku buildpacks:add --index 2 heroku/ruby --app trocos

3. Add Heroku Postgres

sh
heroku addons:create heroku-postgresql:essential-0 --app trocos

This provisions a PostgreSQL database and sets DATABASE_URL automatically.

4. Set config vars

sh
heroku config:set RAILS_ENV=production --app trocos
heroku config:set SECRET_KEY_BASE=$(rails secret) --app trocos

OAuth providers (optional) — only set the variables for the providers you want to enable:

sh
heroku config:set GITHUB_CLIENT_ID=... GITHUB_CLIENT_SECRET=... --app trocos
heroku config:set DISCORD_CLIENT_ID=... DISCORD_CLIENT_SECRET=... --app trocos
heroku config:set SLACK_CLIENT_ID=... SLACK_CLIENT_SECRET=... --app trocos

See the OAuth Setup guide to create these app credentials.

5. Deploy

Connect your GitLab or GitHub repo from the Heroku dashboard (Settings → Deploy), or push directly:

sh
heroku git:remote --app trocos
git push heroku main

6. Run migrations and initial setup

sh
heroku run bundle exec rails db:migrate --app trocos
heroku run bundle exec rails trocos:setup --app trocos

trocos:setup creates your first admin account.

7. Open your app

sh
heroku open --app trocos

Your TrocOS instance is live at https://trocos.herokuapp.com.

Optional: Custom domain

sh
heroku domains:add www.example.com --app trocos
heroku certs:auto:enable --app trocos

Heroku provisions a Let's Encrypt certificate automatically when SSL ACM is enabled.

Released under the AGPL-3.0 License.