Skip to content

Instantly share code, notes, and snippets.

Last active February 23, 2022 18:00
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jannispaul/3787603317fc9bbb96e99c51fe169731 to your computer and use it in GitHub Desktop.
My modified tutorial for Staticman on Heroku

Selfhosted staticman instance on Heroku

Setup is based on these tutorials


  1. Create a new GitHub account for the Staticman API

  2. Create a GitHub token with repo acccess (check the repo checkbox) for the new account:,

  3. Clone an instance of Staticman: git clone

  4. Move into the staticman folder: cd ~/staticman

  5. In the staticman folder, create a file called Procfile and store a single line in there: web: npm start

  6. Create a private RSA key for use with the API: openssl genrsa -out key.pem

  7. Create a Heroku account

  8. Log into the Heroku CLI using heroku login,

  9. Create a new Staticman app and configure it:

     heroku create {nameOfYourStaticmanApp}`
     heroku config:set NODE_ENV="production" 
     heroku config:set RSA_PRIVATE_KEY="$(cat key.pem)" 
     heroku config:set GITHUB_TOKEN="Your_Token"
  10. Create a production branch: git checkout -b production origin/dev

  11. Add !config.production.json to .gitignore

  12. Commit the changes:

    git add config.production.json Procfile .gitignore 
    git commit -m "Set up Staticman v3 for deployment to Heroku"
  13. Deploy the API: git push heroku production:master

  14. After the API has been built successfully, you should be greeted with Hello from Staticman version 3.0.0! when visiting your API instance at https://{nameOfYourStaticmanApp}

Fixing it

On POST using the API endpoint https://{nameOfYourStaticmanApp}{githubUsername}/{repositoryName}/{branchName}/{folderLikeCommentsOrReviews} the instance should show an error: "Internal Server Error"

To fix it use this pull request eduardoboucas/staticman#288

git pull origin pull/288/head
git push heroku

In case that pull request doesnt work check out these

eduardoboucas/staticman#299 (comment)

Copy link

Thanks, I changed the wording. With "full repo access" I meant all the checkboxes listed under repo. Those are active in your tokens too, right?

Copy link

Thanks for clarification. Yeah, for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment