NetrunHome

What to choose

GitHub Pages alternative when your site needs a server, form or database

· 5 min read

In short

GitHub Pages only hosts static sites made of HTML, CSS and JavaScript, so a server, form handling or a database needs a host that runs server code. Pages does not execute PHP, Python or server-side Node.js and cannot store data your visitors send. If your site needs that part, publish it on an app host such as Netrun, where the site and its server run behind one HTTPS link. For a business card site, documentation or a portfolio without a form, GitHub Pages is more than enough.

  • GitHub Pages is static site hosting: it publishes HTML, CSS and JavaScript from a repository and runs no server code.
  • A published GitHub Pages site can be at most 1 GB, and the soft bandwidth limit is 100 GB per month.
  • Under GitHub rules, Pages may not be used as free hosting for an online store, an online business or a commercial SaaS.
  • On a free GitHub account a Pages site can be published only from a public repository, and from a private one only on paid GitHub plans.
  • A secret key in the code of a static site is visible to every visitor, so calling a paid API with a key requires a server side.

GitHub Pages is a great way to put a site online for free: push the files to a repository, turn Pages on in the settings, and a couple of minutes later the site is live. Thousands of portfolios, documentation sites and landing pages live this way. Pages has one limitation, but a fundamental one: it serves ready-made files and runs no program on its side.

As long as the site is just pages, that is enough. But sooner or later you want the contact form to actually collect messages, or you want user logins, comments, a product database or a call to an AI model with a key. All of that needs a server, a program that receives data and does something with it. Below is how to tell you have outgrown GitHub Pages and where to go next.

GitHub Pages and Netrun: what your site can do
What the site needsGitHub PagesNetrun
Static pages (HTML, CSS, JS)Yes, for freeYes
Server code: PHP, Python, Node.jsNoYes, the language is detected automatically
Handling a form on your own serverNo, only through a third-party serviceYes, the form handler is part of your app
A databaseNoSQLite in the /data folder or your own database in docker-compose
Secret API keysNowhere to hide them: the code is visible to visitorsStored encrypted in the project secrets
Code in a private repositoryOnly on a paid GitHub planImport from a private repository or upload an archive
Custom domain and HTTPSYesHTTPS right away, a custom domain on the Pro plan
Behaviour with no visitorsThe site is always availableOn the free plan it sleeps and wakes up in a few seconds
  1. Check whether your site needs a server#

    You need a server if the site has to take data from visitors and do something with it: store requests, register users, calculate, send emails, or call a paid API with a secret key. If the site only shows text, images and links, you need no server, and GitHub Pages is the best fit. A good sign is files such as app.py, server.js or index.php, or an api folder, in your project.

  2. Stay on GitHub Pages if the site is static#

    A business card site, a portfolio, documentation, a blog built with a static site generator: all of these live happily on Pages for free and never sleep. The Pages limits are generous, with up to 1 GB per published site and a soft limit of 100 GB of bandwidth per month. There is no point moving just for the sake of it.

  3. Do not hide keys in static site code#

    A common mistake is to call an AI model or a paid service straight from JavaScript on the page and put the key in the code. On a static site every visitor downloads that code, so the key is visible to everyone and gets stolen quickly. The key belongs on a server, and the page should call your server, which then calls the paid service itself.

  4. Decide how to handle your form#

    For a single contact form you can stay on Pages and plug in a third-party form service that forwards submissions to your email. If you need to store submissions, show them in your own admin page, forward them to Telegram or validate them, it is easier when the form handler is part of your own app. Then the site and the server live together and do not depend on another service and its limits.

  5. Move the site together with its server#

    Once you need a server, upload the project to a host that runs it. On Netrun you can import the project from GitHub, including a private repository, or upload an archive: the language is detected from the files, and the site should listen on 0.0.0.0 and on the port from the PORT environment variable. Add your keys in the Secrets tab, and keep an SQLite database in the /data folder so it survives code updates.

  6. Account for sleep and your domain#

    On the free Netrun plan a site sleeps when nobody visits and wakes up in a few seconds when the link is opened, unlike Pages, where a static site is always available. You get an HTTPS link right away, and a custom domain is connected on the Pro plan, where the site also runs without sleeping. If you already have a domain that pointed to Pages, after the move you only need to change the DNS record at your registrar.

GitHub Pages is the right choice while your site is static: it is free, fast and never sleeps. The time to replace it is when the site needs a program on a server, such as a form that stores submissions, user logins, a database or a key to a paid API. Then it is easier to keep the site and its server in one place: import the repository or upload an archive, and Netrun gives you an HTTPS link. Try Netrun.

Common questions

Can I run PHP or Python on GitHub Pages?

No. GitHub Pages only serves ready-made files such as HTML, CSS, JavaScript and images, and runs no code on its side. Python, PHP or server-side Node.js will not run there. They need a host that runs your application.

How do I make a contact form on GitHub Pages?

Only through a third-party form service: the page sends the data to it, and it forwards the message to your email. You cannot build your own handler on Pages, because there is no server. If you need to store or process submissions, move the site to a host with a server side.

Can I run an online store on GitHub Pages?

Under GitHub rules, no: Pages may not be used as free hosting for an online business, an online store or a commercial SaaS. GitHub also advises against sending passwords or card numbers through such sites. A store needs regular hosting with a server or a ready-made store platform.

Why can my GitHub Pages site not reach the database?

Because Pages has no server that could connect to it. You can call an external database straight from the browser, but then the access key is visible to every visitor. The reliable way is your own server that keeps the key and talks to the database itself.

Can I move my site off GitHub Pages and keep my domain?

Yes. The domain belongs to you, not to GitHub, so after the move you only need to change the DNS record at your registrar. On Netrun custom domains are connected on the Pro plan, and the HTTPS certificate is issued automatically.

How do I put a website online?

Upload your site code as a ZIP archive or from GitHub — Netrun builds it and gives you a working link with HTTPS. A static site (HTML, CSS, JS), a React app or a Python site all work. There is no domain to buy and no server or certificates to set up.

Can I connect my own domain?

Yes, on the Pro plan, and not just one: you can connect as many of your own domains to a website as you need. Open the “Domains” tab on the project page, enter the domain you bought from a registrar, and add the DNS record shown in the hint — every next domain is added the same way. Once the domains are ready, press “Check”: Netrun checks them all at once and issues a separate HTTPS certificate for each, so a hiccup with one domain does not hold up the others. The site opens at any of your addresses, and the Netrun link stays as a backup. If you connect a whole domain (for example myshop.com), you can add one more record so the site also opens with www. This is for websites — a bot or a background script does not need a domain.

Is my data kept when I update the code?

Yes, as long as your data lives in persistent storage. For a regular project that is the /data folder: anything your app saves there stays in place when you update the code or restart, and you can browse and download the files on the "Data" tab. If you described the services yourself in docker-compose, persistent storage means the named volumes from your file, and such a project has no /data folder. Files written outside persistent storage are created from scratch on the next deploy. Your project link stays the same either way.

Get your own project online

Upload your code, answer a couple of questions and get a working link. There is a free plan

Try Netrun
All blog articles