Heroku¶
Note: Installations to Heroku require a local machine with some flavour of unix, as NodeBB does not run on Windows.
Download and install Heroku Toolbelt for your operating system
Log into your Heroku account:
heroku loginVerify your Heroku account by adding a credit card (at http://heroku.com/verify). Required for enabling Redis To Go Add-on.
Clone the repository:
git clone -b v0.8.x https://github.com/NodeBB/NodeBB.git /path/to/repo/clonecd /path/to/repo/cloneInstall dependencies locally
npm install --productionCreate the heroku app:
heroku createEnable Redis To Go for your heroku account (Nano is a free plan):
heroku addons:create redistogo:nanoRun the NodeBB setup script:
node app --setup(information for your Heroku server and Redis to Go instance can be found in your account page)- Your server name is found in your Heroku app’s “settings” page, and looks something like
adjective-noun-wxyz.herokuapp.com - Use any port number. It will be ignored.
- Your redis server can be found as part of the redis url. For example, for the url:
redis://redistogo:h28h3wgh37fns7@fishyfish.redistogo.com:12345/ - The server is
fishyfish.redistogo.com - The port is
12345 - The password is
h28h3wgh37fns7
- Your server name is found in your Heroku app’s “settings” page, and looks something like
Add the following two packages to the
dependenciessection of yourpackage.json:
"dependencies": {
...
"redis": "~0.10.1",
"connect-redis": "~2.0.0"
},
"devDependencies": {
- Create a Procfile for Heroku:
echo "web: node loader.js --no-daemon" > Procfile - Commit the Procfile:
git rm npm-shrinkwrap.json && git add -f Procfile config.json package.json && git commit -am "adding Procfile and configs for Heroku"
- Push to heroku:
git push -u heroku v0.8.x:master* Ensure that a proper SSH key was added to your account, otherwise the push will not succeed! - Initialise a single dyno:
heroku ps:scale web=1 - Visit your app!
If these instructions are unclear or if you run into trouble, please let us know by filing an issue.
Keeping it up to date¶
If you wish to pull the latest changes from the git repository to your Heroku app:
- Navigate to your repository at
/path/to/nodebb git pullnpm installnode app --upgradegit commit -am "upgrading to latest nodebb"git push