![]() |
VOOZH | about |
Deploying a basic static HTML website on Heroku involves hosting simple web pages using Heroku’s platform by configuring the app and pushing code to the Heroku server.
Ensure you have the required tools and accounts set up before starting the deployment process.
Follow these steps to create and successfully host a simple static portfolio website on Heroku.
Create a folder named portfolio and move into it.
$ mkdir portfolio
$ cd portfolioCreate a basic HTML file named home.html.
$ echo "<h1> My Portfolio </h1>" > home.htmlHeroku requires a backend, so create a simple PHP file and an empty composer.json.
$ echo '<?php include_once("home.html"); ?>' > index.php
$ echo '{}' > composer.jsonInitialize your project as a Git repository.
$ git initGo to the Heroku dashboard and create a new app.
Example app name: your-app-name-123
Login using the Heroku CLI.
$ heroku loginLink your local repository to the Heroku app.
$ heroku git:remote -a your-app-name-123Push your project to Heroku.
$ git push heroku master$ git add .
$ git commit -m "your commit message"
$ git push heroku master