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 login
- Verify your Heroku account by adding a credit card (at http://heroku.com/verify). Required for enabling mLab MongoDB Add-on.
- Clone the repository:
git clone -b v2.x https://github.com/NodeBB/NodeBB.git /path/to/repo/clone
cd /path/to/repo/clone
- Create the heroku app:
heroku create
- Enable mLab MongoDB
for your heroku account (Sandbox
is a free plan):
heroku addons:create mongolab:sandbox
-
Run the NodeBB setup script:
./nodebb setup
(information for your Heroku server and mLab MongoDB instance can be found in your account page)- Your server name is found in your Heroku app's "settings"
page, and looks something like
https://adjective-noun-wxyz.herokuapp.com
- Use any port number. It will be ignored.
- Your MongoDB server can be found as part of the mongoDB url. For
example, for the url:
mongodb://heroku_b5mwv5hk:[email protected]:61391/heroku_b5mwv5hk
- The host is
ds151291.mlab.com
- The port is
61391
- The username is
heroku_b5mwv5hk
- The password is
8i0hd53a35qhd7bd2p8lm0m4do
- The host is
- Your server name is found in your Heroku app's "settings"
page, and looks something like
-
Create a Procfile for Heroku:
echo "web: node loader.js --no-daemon" > Procfile
- Commit the Procfile:
git add -f Procfile config.json package.json build && git commit -am "adding Procfile and configs for Heroku"
- Push to heroku:
git push -u heroku v2.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 creating a topic on the Community Support Forum.
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 pull
npm install
node app --upgrade
git commit -am "upgrading to latest nodebb"
git push
Upload Support
Given the Heroku doesn't uses a persistant storage, to avoid losing uploaded assets, remember to follow the solution in Uploads to setup a persistant storage.