Skip to content
Serve all the things!
HTML CSS ApacheConf
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Heroku Static

An example for putting static sites on Heroku, taken from Kenneth Reitz's blog post.


First, make sure you have the Heroku CLI installed.

You need the blank index.php and correct .htaccess file in order for Heroku to serve your static site. You can then create your new Heroku application by running the following on the commandline (with your application's name substituted for my-app-name):

heroku create my-app-name -s cedar
git push heroku master

You can then open your new static site with the following command:

heroku open


During development, you'll probably want to still use localhost when working on your project — rather than simply looking at the index.html file in your browser of choice. You can use Python to serve your content during development:

cd path/to/my/project
python -m SimpleHTTPServer

Your project should then be up and running on: localhost:8000

Custom Domain

Attaching your own custom domain to your Heroku instance is pretty easy.

heroku addons:add custom_domains
heroku domains:add
heroku domains:add

Make sure to attach the following A records using your DNS management tool:

For more information, make sure to read this Heroku devcenter article.

You can’t perform that action at this time.