Hosting a html+css+js webpage on statichost.eu using a private github repository
Hi, my name is Roman and I am a hobbyist at web hosting. I might sometime not use the correct wording here or state some contradicting things.
Please note that I am not advertising any of the brands below. I mention them only so you can follow my steps. There might be plenty of other services.
I manage my source on github. There is a comprehensive how to get started page. The repostitory I am using is private. So there are some additional steps I had to take (see below).
The hoster is statichost. So I can be GDPR-compliant.
I bought and registered my domain at a German provider. I guess most providers will do.
A step by step guide
Here I leave out the part of webpage creation and the part of managing it on github, since this is not the main objective of this post. I am leaving out my trial and error (I am a hobbyist :-)) here as well, which where very quickly solved by Eric from statichost. He was very responsive.
Config for statichost
In the root folder of the webpage you have to provide a config file to tell statichost build process what to do. The file is called
The basic structure of my webpage folder looks like this, where
my-page is the root of the webpage:
Since the page does not need any build process, there is no build configuration here. However, since I am using a custom domain I have to configure it as described in the statichost documentation. Let’s say the domain is
mypage.com, then the following would be the configuration:
# Public directory points to the webpage root
# folder and, in this case, is a dot using
# the github repository root
# This configures the custom domain
# Primary domain
# Domains that redirect to the primary
Lines starting with # are comments. You can leave them out.
Additionally to this, I had to configure my domain hosters site. As described in the statichost documentation, I added a
CNAME DNS record to
Eric from statichost told me to add an
A record with the IP Address 184.108.40.206 to my DNS records as well to use the root domain as described in the docs.
Signing up to statichost
First you have to sign up:
- go to statichost
- click the Sign up button in the top right corner
- enter your email address
- look for the email with the link to log in
There is no user password here. All is done via the
magic email link.
Adding a webpage
Then you have to add your webpage after logging in:
- click the
- enter your github repository and a name for your page
- click the
Since I am using a private github repository, the build was not successful. However, the build log gave me the public key I had to add to the github repository.
Adding the public key to github
- go to your github (or other git) repository
- click on
Settingsof the repository menu
- the menu with
- not the github settings of your account
- the menu with
- at the left menu click
- at the top right click
Add deploy key
- fill in a title (any is fine) and the key
Now you should be able to build your site at statichost.
Build your site (again)
- log into your page at statichost
- at the menu on your left click
- at the next page click
Automatic deployment from github
If you prefer your page being automatically built/uploaded after you committed changes to github you can do so by configuring a webhook. This is described in the statichost documentation. For me this is the way I do it. I do some changes on my page locally. Then I commit it to github and a few seconds later the fully automated process is finished and my webpage is up to date.
A big thank to statichost and especially to Eric.