Skip to content

Latest commit



151 lines (122 loc) · 7.59 KB

File metadata and controls

151 lines (122 loc) · 7.59 KB

Deploy to Heroku

Huginn works very well on the cheapest Heroku paid plan. This is what we recommend if you want to use Huginn on Heroku.

Notes for any Heroku plan:

  • The setup_heroku command points Heroku at a special Procfile (deployment/heroku/Procfile.heroku) that is designed to be run on only one Heroku web worker. If you want to run multiple workers, change the Heroku config variable PROCFILE_PATH with heroku config:set PROCFILE_PATH=./Procfile and switch back to the standard Huginn Procfile configuration.

If you still wish to use the Heroku free plan (which won't work very well), please understand the following:

  • Heroku's free plan limits total runtime per day to 18 hours. This means that Huginn must sleep some of the time, and so recurring tasks will only run if their recurrence frequency fits within the free plan's awake time, which is 30 minutes. Therefore, we recommend that you only use the every 1 minute, every 2 minute, and every 5 minute Agent scheduling options.
  • If you're using the free plan, you need to signup for a free uptimerobot account and have it ping your Huginn URL on Heroku once every 70 minutes. If you still receive warnings from Heroku, try a longer interval.
  • Another way if you're using the free plan, you can create a Http Status Agent on your Heroku Huginn instance itself and ping your own domain at every 10 minutes.
  • Heroku's free Postgres plan limits the number of database rows that you can have to 10,000, so you should be sure to set a low event retention schedule for your agents and set AGENT_LOG_LENGTH, the number of log lines kept in the DB per Agent, to something small: heroku config:set AGENT_LOG_LENGTH=20.
  • 512MB of RAM may not be enough for Huginn and it may stop working as RAM usage increases over time.


  • Install the Heroku Toolbelt and then run heroku login
  • Go into your huginn directory and run cp .env.example .env && bundle
  • Now, run the magic setup wizard: bin/setup_heroku
  • That's it!
  • If you make changes, you can re-run bin/setup_heroku, or just do git push heroku master.
  • Follow these instructions when you want to update your Huginn installation.

Using your own mail server

# Outgoing email settings.  To use Gmail or Google Apps, put your Google Apps domain or
# as the SMTP_DOMAIN and your Gmail username and password as the SMTP_USER_NAME and SMTP_PASSWORD.
heroku config:set
heroku config:set
heroku config:set SMTP_PASSWORD=somepassword
heroku config:set

# The address from which system emails will appear to be sent.
heroku config:set

Backing up your data


Example output from bin/setup_heroku

~/projects/oss/huginn (master)$ bin/setup_heroku 

Welcome!  It looks like you're logged into Heroku.

It looks like you don't have a Heroku app set up yet for this repo.
You can either exit now and run 'heroku create', or I can do it for you.
Would you like me to create a Heroku app for you now in this repo? (y/n) y
Creating radiant-forest-1519... done, stack is cedar |
Git remote heroku added
Your Heroku app name is radiant-forest-1519.  Is this correct? (y/n) y
Setting up APP_SECRET_TOKEN...
Setting PROCFILE_PATH to deployment/heroku/Procfile.heroku
PROCFILE_PATH: deployment/heroku/Procfile.heroku
Setting ON_HEROKU to true
Setting FORCE_SSL to true
Setting DOMAIN to

You need to set an invitation code for your Huginn instance.  If you plan to share this instance, you will
tell this code to anyone who you'd like to invite.  If you won't share it, then just set this to something
that people will not guess.
What code would you like to use? 
What code would you like to use? something-secret
Setting INVITATION_CODE to something-secret

Okay, let's setup outgoing email settings.  The simplest solution is to use the free sendgrid Heroku addon.
If you'd like to use your own server, or your Gmail account, please see .env.example and set
Should I enable the free sendgrid addon? (y/n) y
Use `heroku addons:docs sendgrid` to view documentation.
What email address would you like email to appear to be sent from?

Should I push your current branch (master) to heroku? (y/n) y
This may take a moment...
Initializing repository, done.

-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack:
=====> Detected Framework: Selectable Procfile
-----> Using deployment/heroku/Procfile.heroku as Procfile
=====> Downloading Buildpack:
=====> Detected Framework: Ruby
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Fetching source index from
       Fetching git://
       Installing i18n 0.6.9
       Installing rake 10.3.2
       Installing minitest 5.3.5
       [...gems are installed...]
       Your bundle is complete!
       Gems in the groups development and test were not installed.
       It was installed into ./vendor/bundle
       Post-install message from httparty:
       When you HTTParty, you must party hard!
       Post-install message from rufus-scheduler:
       Bundle completed (133.85s)
       Cleaning up the bundler cache.
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       I, [2014-07-26T20:36:06.069156 #5939]  INFO -- : Writing /tmp/build_7b0d30bd-3c35-46dc-b73d-b5f05754d340/public/assets/select2x2-ec4bf2b76c97838b357413d72a2f69cf.png [...]
       Asset precompilation completed (42.28s)
       Cleaning assets
       Running: rake assets:clean

Using release configuration from last framework (Ruby).
-----> Discovering process types
       Procfile declares types     -> web
       Default types for Multipack -> console, rake, worker

-----> Compressing... done, 45.1MB
-----> Launching... done, v19 deployed to Heroku

 * [new branch]      master -> master
Running database migrations...
Running `rake db:migrate` attached to terminal... up, run.3341

[...migrations run...]

I can make an admin user on your new Huginn instance and setup some example Agents.
Should I create a new admin user and some example Agents? (y/n) y

Okay, what is your email address?
And what username would you like to login as? andrew
Finally, what password would you like to use? 
Just a moment...

Okay, you should be all set!  Visit and login as 'andrew' with your password.