Skip to content

Instantly share code, notes, and snippets.

@deanrather
Last active December 25, 2025 05:11
Show Gist options
  • Select an option

  • Save deanrather/6d63e9dcdf823957b171 to your computer and use it in GitHub Desktop.

Select an option

Save deanrather/6d63e9dcdf823957b171 to your computer and use it in GitHub Desktop.
Free Hosting on GitHub

Free Hosting on GitHub

This guide will take you from zero webserver knowledge, to having your own free site hosted on GitHub. The only non-free bit is registering a domain name, which can be as cheap as $5/year.

This guide uses CrazyDomains as the Registrar, FreeDNS as the DNS, and GitHub as the Webserver.


1) Domain Registration and Setup

The Domain Name Registrar is where you register your domain name, This is the only not free step. Your registrar needs to know which DNS Server will associate the Domain Name with a WebServer. I've got mine with CrazyDomains, as they offer the cheapest .com.au domains.

  1. Create an account, chuck in your payment details, etc.
  2. Register your domain(s)
  3. Set your domains Name Servers to ns1.afraid.org, ns2, ns3, and ns4.

2) Setup your DNS

Edit: Ignore this section and use CloudFlare instead. It's free, it's a DNS, It's also a CDN, and it's also easier.

I use FreeDNS, cause it's free, and doesn't look too dodgy.

  1. Set up an account, login
  2. Go to Domains -> Add a Domain to FreeDNS Domain: yourdomain.com Shared State: Shared: Public
  3. Go to Domains -> yourdomain.com -> Manage
  4. Click the Add button at the top-right Type: A Subdomain: blank Domain: yourdomain.com (public)(broken!) Destination: 192.30.252.153 Wildcard: ticked
  5. Click the Add button next to yourdomain.com again, same settings as last time, but this time use the ip: 192.30.252.154

3) Set Up your Website on GitHub

  1. go to GitHub.com, create an account, and login
  2. Create a new Repository, mame it yourdomain.com, leave it as Public, and tick `Initialize this repository with a README``
  3. Click Settings (in the right-middle -- for the repo, not for your account)
  4. Under Github Pages click Automatic page generator
  5. Make any changes you like, put in a Google Analytics ID if you want awesome free stats, click Continue to layouts
  6. Choose a theme, or just go with the default and change it later. Click Publish Page
  7. Your page can now be viewed at http://<your github username>.github.io/<your repo name>/
  8. Back on your repo's page, click Branch: master and change to the gh-pages branch
  9. Next to the Branch selector, it will show yourdomain.com, followed by a / and a +. Click the + to create a new file.
  10. Name the file CNAME and put yourdomain.com inside as the contents, click Commit new file to save it.

--

That's it! Everything's set up!

It can take up to 24 hours for the Domain Name to propogate, sometimes it only takes a few minutes thoughu. Until then browsing to yourdomain.com will just return an error. If you're really impatient you can add it to your computer's hosts file, otherwise just wait it out.


Tips

  • Settings -> Default branch: gh-pages
@javed4267
Copy link

#!/bin/bash

echo "=== Minecraft Lifesteal Server Auto Setup ==="

Create folders

mkdir -p plugins

Create eula

cat > eula.txt <<EOF
eula=true
EOF

Create server.properties

cat > server.properties <<EOF
online-mode=false
enable-command-block=true
motd=FREE LIFESTEAL SMP SERVER
max-players=20
spawn-protection=0
difficulty=hard
pvp=true
EOF

Create start.sh

cat > start.sh <<EOF
#!/bin/bash
java -Xms1G -Xmx2G -jar server.jar nogui
EOF
chmod +x start.sh

Create Dockerfile

cat > Dockerfile <<EOF
FROM openjdk:17
WORKDIR /app
COPY . .
RUN chmod +x start.sh
EXPOSE 25565
CMD ["./start.sh"]
EOF

echo "==========================================="
echo "NOW DOWNLOAD THESE MANUALLY:"
echo "1) PaperMC β†’ rename to server.jar"
echo " https://papermc.io/downloads"
echo
echo "2) Lifesteal Plugin β†’ plugins/Lifesteal.jar"
echo " https://www.spigotmc.org/resources/lifesteal-smp.94387/"
echo
echo "3) HeadSteal Plugin β†’ plugins/HeadSteal.jar"
echo " https://www.spigotmc.org/resources/headsteal.99118/"
echo "==========================================="
echo "UPLOAD ALL FILES TO RAILWAY OR RENDER"
echo "SERVER READY πŸš€"

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