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.
  • jqubed@lemmy.world
    link
    fedilink
    English
    arrow-up
    25
    arrow-down
    1
    ·
    8 days ago

    There’s actually a surprising amount of free static website hosting out there. Besides GitHub, GitLab, Cloudflare, and Netlify come to mind offhand.

  • neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    18
    ·
    edit-2
    8 days ago

    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?

    • LifeInMultipleChoice@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      8 days ago

      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.

  • Cousin Mose@lemmy.hogru.ch
    link
    fedilink
    English
    arrow-up
    12
    ·
    8 days ago

    Use any static site generator and build a Docker container. You could even try out this idea though its lack of http/2+ support might not make it the best option.

      • Cousin Mose@lemmy.hogru.ch
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 days ago

        I think it depends on the number of assets. Generally speaking you’re probably right, but if there are a lot of small files it would be a lot smoother to load them over http/2.

        • atzanteol@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          8 days ago

          There is zero question about it. It will be absolutely fine for some dude’s static website over a residential internet connection.

  • csm10495@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    9
    ·
    8 days ago

    Something that may help:

    Why doesn’t GitHub Pages fit your use case? It’s nice to get free static hosting from them.

      • csm10495@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        17
        arrow-down
        2
        ·
        8 days ago

        In what way? Anything on the public internet is likely being used for AI training. I guess by using free GitHub you can’t object to training.

        Then again anywhere you host you sort of run into the same problem. You can use robots.txt, but things don’t have to listen to it.

        • jqubed@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          ·
          8 days ago

          Self-hosting there are some ways to fight back, or depending on your opinions on Cloudflare it seems they’re fairly effective at blocking the AI crawlers.

          • AmbiguousProps@lemmy.today
            link
            fedilink
            English
            arrow-up
            2
            arrow-down
            1
            ·
            8 days ago

            Yep, on top of simply blocking, if you’re self hosting or using cloudflare, you can enable AI tarpits.

  • sorter_plainview@lemmy.today
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    edit-2
    8 days ago

    Hosting site in your local machine is tricky. It depends on how your ISP configured your network and most of the time you will be under CGNAT. Which means you will not have a unique public IP, but a shared one. Similarly your IP will be dynamic which will need additional configurations. Nowadays it is very difficult to host a site on local machine directly.

    Edit: Checkout if your ISP provide unique IPv6 for your machine. This will not have issues of CGNAT, but you will have to setup DynamicDNS (DDNS) to accomate the changes in IP.

    Edit: If there is CGNAT and you don’t have IPv6, then you need ‘NAT Hole Punching’. Usually services like Tailscale, ZeroTier, Amnezia, Innernet, v2ray, etc. are needed for that.

    One thing you can try is Tailscale Funnel. Fair warning, bending your head around functioning of Tailscale is not trivial, and you will have to spend some time to properly understand and set it up.

    If you prefer a simpler route, free hosting of a static site is your best bet.

    Netlify is the go to solution if you are familiar with Git. I used to have my portfolio up there. Another option is, as you mentioned, Github Pages.

    Vercel is the another common one people use. But it might be a little more tricky to get it working, because it focus on front end framework like Next.js.

    Checkout Cloudflare Pages too. Very much similar to GitHub Pages, but with the performance and reliability of Cloudflare.

    Heroku is another thing people used in the past. I think the free tier got limited nowadays.

    Good luck with your adventures.

    • littleomid@feddit.org
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      2
      ·
      edit-2
      8 days ago

      It’s not “very difficult” to self host. Arguably it’s one of the easier public things to self host. Takes an inexperienced IT enthusiast maybe 2 hours to setup.

    • BootLoop@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 days ago

      Depends on your ISP. In my case my IP hasn’t changed in the two years I’ve been with them so it was easy as setting up port forwarding in my router. Took a minute or two.

  • K3CAN@lemmy.radio
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    8 days ago

    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.

  • Hawk@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    5
    ·
    8 days ago

    You could port forward.

    However, I’d buy a digital droplet for 10 USD a month, point the A record of the domain to that and then use Caddy to implement SSL.

    Caddy can run a http server or reverse proxy something on localhost.

    • DragonBard@ttrpg.network
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 days ago

      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.

  • AnarchistArtificer@slrpnk.net
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 days ago

    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.

  • meh@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 days ago

    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.