Codanaut's
Tech Hub

Free web hosting with Gitlab & Github

Ready to host your website for free? Learn how to use GitLab or GitHub Pages and save your budget while still having a professional-looking website!


Astro

Using GitLab or GitHub Pages to Host Basic Websites for Free

If you’re looking to host a basic website without having to pay for hosting services, you may want to consider using GitLab or GitHub Pages. Both platforms offer free hosting for static websites, which can be a great option for personal projects or small businesses with limited budgets. In this article, we’ll explore the benefits of using GitLab or GitHub Pages and walk you through the process of setting up your website.

Benefits of Using GitLab or GitHub Pages

There are several benefits to using GitLab or GitHub Pages to host your website, including:

  1. Free hosting: As previously mentioned, GitLab and GitHub Pages offer free hosting for static websites. This means you won’t have to pay for hosting services, which can be a significant cost savings.

  2. Easy setup: Setting up your website on GitLab or GitHub Pages is straightforward and doesn’t require any advanced technical knowledge. You can get your website up and running in just a few minutes.

  3. Version control: GitLab and GitHub Pages both use version control, which means you can track changes to your website over time. This can be particularly useful if you’re working on a project with multiple contributors.

  4. Custom domain support: Both platforms allow you to use your own domain name for your website, which can give your site a more professional appearance.

Setting Up Your Website on GitLab or GitHub Pages

Now that you know the benefits of using GitLab or GitHub Pages, let’s walk through the process of setting up your website.

Step 1: Create a Repository

The first step is to create a new repository for your website. If you’re using GitLab, log in to your account and navigate to the dashboard. Click the “New project” button and select “Blank project.” Give your project a name and click “Create project.”

If you’re using GitHub, log in to your account and navigate to the dashboard. Click the “New” button and select “Repository.” Give your repository a name and click “Create repository.”

Step 2: Upload Your Website Files

Next, you’ll need to upload your website files to your repository. You can do this through the GitLab or GitHub website, or you can use Git to push your files to the repository.

If you’re uploading files through the website, click the “Upload file” button and select the files you want to upload. If you’re using Git, clone the repository to your local machine, add your files, commit your changes, and push your changes to the repository.

Step 3: Set Up Your Website

Once your files are uploaded, you’ll need to set up your website. If you’re using GitLab, navigate to your project’s settings and click the “Pages” tab. Select the branch you want to use for your website and click “Save.” Your website should now be live at https://<your-username>.gitlab.io/<your-project-name>/.

If you’re using GitHub, navigate to your repository’s settings and click the “Pages” tab. Select the branch you want to use for your website and click “Save.” Your website should now be live at https://<your-username>.github.io/<your-repository-name>/.

Step 4: Configure Your Domain

If you want to use your own domain name for your website, you’ll need to configure your domain settings. Both GitLab and GitHub provide instructions for configuring your domain, which typically involves adding a CNAME file to your repository and configuring your domain’s DNS settings. We will cover this in-depth later on.

Conclusion

Hosting a basic website on GitLab or GitHub Pages is an easy and affordable way to