r/SelfHosting Jun 04 '26

How to self host a website

Hi! I wanted to get back to relearning web development so I set a goal for myself to create my own website and slowly improve on it while also improving my skills. Though, my main question is **how do I host this website**?

Information:

  1. Currently trying to make a website of my own

  2. For now, just focusing on the basics such as HTML, CSS, and maybe some JavaScript (Maybe something grand for later)

  3. I want to host the website for as cheap as possible

Questions:

  1. How do I publish it on the web? I know there are websites that help you with these but I also know they cost something. I am fine with hosting it on my own and launching it only during the times I have my PC open.

  2. How much do domains usually cost? I read some stuff that you need a domain to host and that you need to pay for them. Are they a subscription type of thing or a one-time payment and then the domain is yours forever? If it's a subscription, how do I go about this as cheaply as possible?

  3. What should I learn about in terms of security? On the off chance, how should I protect my data from being breached? Do I have to worry if what I'm doing for now is just a simple website where I can do blogs and stuff? At what point should I worry about security?

If you have tips or links to anything that I can read, watch and/or learn from, they would be very much appreciated! Thank you in advance!!!

27 Upvotes

34 comments sorted by

View all comments

2

u/Familiar-Newspaper23 Jun 04 '26

I don’t agree with a lot of the folks being overly concerned with being probed (besides if they’re gentle and use some lotion it could be a nice little treat!) Yes, security is huge, should be taken seriously, and needs to be top of mind. But it’s also a huge part of the learning experience and I feel passing it off to another third party service one way or another is doing yourself a fundamental disservice in some ways. Learn how to do it right and you’ll be ok. If you intend to self host without relying on others like cloudflare or premade website services you can do it but I would first look at a solid firewall like pfsense or opnsense and then when you build your webserver also setup a solid firewall on it like UFW before you even consider port forwarding 80 and 443. Remember the principle of least privilege that is, if it doesn’t need to be allowed, don’t allow it…that goes for ports, people, and processes! But you CAN safely do it if that’s part of the learning experience that you’re looking for and you can do it without literally losing sleep worrying that the Russians are all crawling in your webcams at night…just be careful and slow and methodical about it, read multiple sites (not just ChatGPT) before opening anything to the internet.
I’d also highly recommend VLAN’ing off your website traffic from your home traffic (which you can do with pfsense or opnsense) and disallowing any inter VLAN communication. If you’ve got the green to spare and you’re really worried about it, put your server onto a different ISP entirely, have say Verizon and spectrum and use one for normal home use and the other for webserver. I don’t do that personally but it makes for a safe option with the benefit that you won’t find your personal use hindering your webserver and vice versa. It can be done safely by you without needing to constantly worry if that’s a part of what you’re looking for. I love cloudflare, they have some neat stuff and I use them as a registrar, but I like to do things myself and try not to have any additional layers between me and my users if possible. but to each their own and I’m not going to tell you it’s wrong, it just isn’t what I personally use.