Is there a good alternative to github pages? I need just a static website up.
- I have a domain.
- I have my site (local machine)
- And that’s all I have.
- I have a machine that could be running 24/7 too.
I use nginx you can have configs for different sites and have the server_name have the domain for each server block (I use a file per site) and you can either do static via a root folder, or proxy_pass for active running servers, and nginx will map the domains to the server blocks you should also have a default, and you can then have multiple domains point to the same ip address, but keep in mind that home internet often has a dynamic ip, so you may need to update it every so often. There is a service to help with the dynamic ip I think noip.com has a solution available, but feel free to look around.
Codeberg pages
You need to qualify this statement, GotHib Pages can mean like two or maybe more things. Do you mean free static site hosting? Do you mean easy static site generation from Markdown files?
- Any of https://staticsitegenerators.bevry.me/
- Any webserver + virtualhost config that serves plain HTML pages
- a build/upload script
I recently used Jekyll (https://jekyllrb.com/) as a static site generator. I found it easy to use. I personally used Gitlab pages, because I didn’t feel confident hosting on my home internet (didn’t want to inadvertently cause issues for my housemates when I’m still learning this stuff).
The nice thing about static sites is that it’s pretty easy to find free or extremely cheap hosting for them.
Ok, so I must’ve misunderstood the question, because to me it seems OP already has all the necessary ingredients to bake this dish. And yet, the vast majority of comments recommend various 3rd party services which is the complete opposite of selhosting.
Fire up nginx/apache2, and all good, no? What am I missing?I was confused when I read it as well, at least I know now that I wasn’t alone. I think the next step is just opening a text editor and starting with <html></html> Forward a couple ports, maybe use caddy to route the port internally but it isn’t needed. Although if you use NOIP with Caddy getting the https cert setup seems to be pretty easy.
I think the missing piece is the website itself? The static HTML page generator?
Something like Hugo
I’m guessing you want to selfhost, rather than use a hosting service?
When you say you have your site already, do you mean it’s hosted on a local webserver, or just that you have the files?
If it’s just the files, you’ll need to choose a webserver. I like NGINX myself, but lighttpd is another option (there’s quite a few options, really, but sticking to a well known option is generally more secure).
Configuration will depend on the server you choose, but then you’ll put the files into three “root folder” used by the webserver. This isn’t the system root ( ‘/’ ), but a different folder specified as the root of your web page, usually ‘/var/www/html or /srv/www/html’.
Once the files are in place, you can test the site by using the web browser on another PC and entering the local IP address of the server. If everything looks good, you can set up port forwarding on your router to forward public port 80 to port 80 on the local server.
Lastly, you will need a DNS provider which will point your domain to the IP address of your router. Assuming you have residential service, you will need to determine whether your IP address is static or dynamic, or if your ISP is utilizing CGNAT. Depending on those factors, you may need to do some additional setup.
Once it is working, your next step will likely be to set up SSL and port forwarding on 443. That will allow your website to be accessed over https, which is the standard for the modern Internet.
I have hosted my own website and a blog for a while, and there are definitely some additional steps I would recommend to take, but the above is your basic starting point.
Your DNS provider may offer static hosting as a paid service. I’m using porkbun and their static hosting is pretty cheap, plus they handle SSL and whatnot for me.
if you’ve already got something at home to run it on and want it easy to set up/maintain. take a look at mkdocs.
You may look at SDF.org they provide shell accounts and hosting.
GitLab has their own version of Pages
There’s actually a surprising amount of free static website hosting out there. Besides GitHub, GitLab, Cloudflare, and Netlify come to mind offhand.
Codeberg does too
Codeberg is not just for static websites. It’s for FOSS projects. Their FAQ addresses this.
I love Fossil-scm. Even host my own instance with my web host. I was considering using github moving forward, but given recent events and decisions by Microsoft, I’ll be sticking with Fossil-scm.