Skip to content

Hosting

Hosting Your LightNet site

Your LightNet site can be hosted on any file server of your choice. To create a folder that can be deployed, run the following command from your project’s root folder:

Terminal window
npm run build

This will create a folder named dist. This folder contains static HTML, CSS, JS, and assets to be put on a web server. Copy it to the file server of your choice.

If you do not have preferences on hosting, you can choose our recommended setup (GitLab & Cloudflare Pages).

Setup Hosting on GitLab and Cloudflare Pages

We recommend using GitLab as the Git repository host. This enables you to collaborate with others, and Cloudflare will use GitLab to read your source code and automatically release when there are new commits.

Cloudflare Pages is recommended to deliver your website to your audience. It takes care of building your website on Cloudflare’s servers, caching, distributing your page around the globe (using Cloudflare’s CDN), and more.

Both GitLab and Cloudflare Pages should be free of charge if your website does not turn into the next YouTube:

  • Cloudflare’s free plan includes unlimited requests to static pages.
  • GitLab’s free plan allows you to collaborate with up to 5 people inside a group.

Setup GitLab

  1. Create a GitLab Account: If you don’t have one, sign up at GitLab.
  2. Add a New Repository: In GitLab, create a new repository for your project.
  3. Push Repository to GitLab: Push your local repository to the newly created GitLab repository.

Setup Cloudflare Pages

  1. Create a Cloudflare Account: Sign up at Cloudflare if you don’t have an account.
  2. Create Cloudflare Pages: In the Cloudflare dashboard, create a new Cloudflare Pages project.
  3. Grant Access to GitLab Repository: Allow Cloudflare to access your GitLab repository.
  4. Configure Pages Settings: Set up the build and deployment settings for your Cloudflare Pages project.

Configure a Cloudflare Domain

Cloudflare Pages will provide you with a .pages.dev domain for free. If you need a custom domain, you can use Cloudflare Domains to purchase a domain registration.

To configure a custom domain:

  1. Purchase a domain from Cloudflare Domains.
  2. Follow the instructions in the Cloudflare dashboard to link your new domain to your Cloudflare Pages project.