Skip to content

Instantly share code, notes, and snippets.

@TravelingTechGuy
Last active December 25, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TravelingTechGuy/6904593 to your computer and use it in GitHub Desktop.
Save TravelingTechGuy/6904593 to your computer and use it in GitHub Desktop.
How to use multiple Heroku accounts, configure the app for production, and websockets
  1. Create a new SSH key pair: ssh-keygen -t rsa -C "your user email"
  2. Call the key pair something unique: mynewheroku_rsa
  3. In the app folder, add Procfile
  4. Add the regular heroku remote: git remote add heroku git@heroku.com:<appname>.git
  5. Edit the file ~/.ssh/config
    Host mynewheroku
        HostName heroku.com
        IdentityFile ~/.ssh/mynewheroku_rsa
        IdentitiesOnly yes
  1. Edit the file .git/config in the head of your folder. Add another remote, that uses the key-pair:
    [remote "heroku-app"]
        url = git@mynewheroku:<appname>.git
        fetch = +refs/heads/*:refs/remotes/heroku/*
  1. Run heroku login, enter user/pass and select the key created in 1 as your key
  2. Now, you have 2 heroku remotes: 1. To push to heroku, use git push heroku-app master 2. The original heroku will be used by the heroku console to control the app
  3. To change the heroku app to production, execute heroku config:set NODE_ENV=production
  4. To add support for web sockets, execute heroku labs:enable websockets This is experimental!!!!! (to disable execute heroku labs:disable websockets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment