I bought a domain, and now how to connect it to my WordPress hosted in my computer? reddit / selfhosted ---------------------------------------------------------------------- BlazingBane007 · 2023-12-20 18:21 Im lost in searching for a solution, I have wordpress instance in my laptop, moslty static content, i want to make it available online, i got a domain from prokbun. i just count fine any thing helpful for the next set. Im lost in searching for a solution, I have WordPress instance in my laptop, mostly static content, i want to make it available online, i got a domain from Prokbun. i just count find anything helpful for the next set. ---------------------------------------------------------------------- flicman · 2023-12-20 18:30 why did you paste this twice? a laptop is probably not going to give your visitors the experience they want, but it should probably work. ---------------------------------------------------------------------- Eirikr70 · 2023-12-20 18:31 You have to set up a reverse proxy. But you have above all to take care of the security of your server. ---------------------------------------------------------------------- Geoffman05 · 2023-12-20 18:33 I would recommend running this on a computer that runs 24/7. With that said, you’re looking for a reverse proxy that’ll apply SSL and safely re-route traffic to your computer from the Internet. Nginx and NPM are two popular options. ---------------------------------------------------------------------- BlazingBane007 · 2023-12-20 18:40 the local-wp has installed and working ngnix, i just dont know how to connect the domain to it.. ---------------------------------------------------------------------- BlazingBane007 · 2023-12-20 18:40 did i? sorry about that i was tired not getting any solution, and i have asked this for many sub reddits, nothing useful has turned in ---------------------------------------------------------------------- BlazingBane007 · 2023-12-20 18:41 yup 24/7, power backup, everything is good, i already nave an nginx, i want to know the steps i have to take to connect this to my domain ---------------------------------------------------------------------- Old_Bug4395 · 2023-12-20 18:46 You need to find your public IP address and assign that to your domain's root A record. After that, you need to forward port 80 and 443 in your router to your laptop's private IP address. You can find this in windows using ipconfig, and in linux using ifconfig/ip. You'll also have to ensure you don't have a firewall enabled on the laptop. I would also recommend not using a laptop for this. Is the laptop at least connected via ethernet cable to your router? ---------------------------------------------------------------------- BlazingBane007 · 2023-12-20 18:48 yes, Lan cable. can i use ngrok? for the initial phase? ---------------------------------------------------------------------- FunDeckHermit · 2023-12-20 18:53 You have a couple of options: 1. Point the domain to your home IP, forward your webserver ports (80, 443) to the laptop. The will fail if you're behind a double NAT or will fail after while if your assigned IP changes. It's good enough for a quick and dirty test. 2. Better would be to use [Dynamic DNS.](https://gist.github.com/taich ikuji/6f4183c0af1f4a29e345b60910666468) 3. Even better would be to rent a VPS and use a WireGuard tunnel to proxy to your laptop. ---------------------------------------------------------------------- BlazingBane007 · 2023-12-20 18:57 can i use ngrok? so that i can atleast feel like its working, then move forward? now the site just shows nothing. it shows, hmmm cant reach this page ---------------------------------------------------------------------- FunDeckHermit · 2023-12-20 19:06 >ngrok Never used it, seems optional. Do you have Python installed on your system? I like testing a with Python to verify my routing is correct. There is a [simple one- liner](https://realpython.com/python-http-server/) to host a http- server with Python. ---------------------------------------------------------------------- SmellsLikeHerpesToMe · 2023-12-20 19:08 Your domain needs an A record to point to your external IP address of your home network. You need to open port 443 for HTTPS, port 80 for HTTP and port forward to your laptops IP address in your router. Again, that being said, I wouldn't expose this laptop if it has any personal information on it. ---------------------------------------------------------------------- fuzz_64 · 2023-12-20 19:09 I use Cloudflare for this. The very condensed version is \- Make Cloudflare free account \- register your domain with them \- they will provide name servers. Enter these with the company where you purchased the domain, allowing Cloudflare to direct the traffic to your computer with their DNS servers \- install Cloudflare's "cloudflared" app on the laptop \- create a tunnel on cloudflare's web portal and point it to your computer's ip address (possibly a 192.168.x.x #) \- apply Cloudflare SSL cert on the laptop to allow for https traffic on your site When users type [www.yourdomain.com](https://www.yourdomain.com) , cloudlare will direct the traffic to your laptop over a secure tunnel. Bonus, you will get a ton of security features for free. You don't have to open firewall ports 80 or 443 on your main Internet router this way. ---------------------------------------------------------------------- librepotato · 2023-12-20 19:10 1. Point your domain (using something like an A record) to your public ip address. You can just look up what your public ip address is on a searcch engine. 2. Open the ports 80 and 443 and point them to the LOCAL IP of your laptop (192.168.x.x) 3. Set your Wordpress's domain (*****.com etc) 4. See if it works. Some ISPs block webservers so it may not work. It's also likely not secure to log in outside your local network, and you'll have to get SSL working and stuff which is a whole mess in and of itself. I would be careful though, you are hosting a web page from a device in your home network. That means an attacker could potentially exploit a vulnerability within wordpress or HTTP and then potentially access other devices in your local network. Ideally you shouldn't be exposing services from home until you know how to secure them. ---------------------------------------------------------------------- Palaract · 2023-12-20 19:12 You can use ngrok for that, but I wouldn't consider this a good solution long term. May I ask what your objective would be in the initial phase? If it is just letting your friends test the website, then ngrok is perfectly fine. If it is for actual deployment then you may do what was recommended to you before by either setting up a reverse proxy on your laptop as well as doing some security measures and finally opening up port 80 and 443 on your router. The best thing would be to use some kind of webhosting for that, either on a cheap VPS where you also can use a reverse proxy or on a dedicated webhosting service. ---------------------------------------------------------------------- borkode · 2023-12-20 19:20 one way would be to use Cloudflare tunnels and then linking your laptop to the homepage of your domain ---------------------------------------------------------------------- borkode · 2023-12-20 19:21 the problem arises if OP's ISP uses a CGNAT then they would not be able to port forward ---------------------------------------------------------------------- borkode · 2023-12-20 19:21 the problem arises if OP's ISP uses a CGNAT then they would not be able to port forward ---------------------------------------------------------------------- kearkan · 2023-12-20 19:32 Considering you seem to lack a certain amount of experience, I would suggest setting up CloudFlare tunnel, that will take care of SSL etc for you. ---------------------------------------------------------------------- Intelligent_Rough_21 · 2023-12-20 19:48 Yes ngrok is very nice for this use case. ---------------------------------------------------------------------- thinkscience · 2023-12-20 21:37 Cloudflare tunnels are the best way for you to expose your services online. ---------------------------------------------------------------------- d03j · 2023-12-20 21:46 >Better would be to use > >Dynamic DNS. https://kb.porkbun.com/article/190-getting-started-with-the-porkbun- api ---------------------------------------------------------------------- travprev · 2023-12-20 22:01 They offer all of this for free? How are they monetizing this or hoping to monetize this? There's always money involved... ? ---------------------------------------------------------------------- DWolfUK40 · 2023-12-20 23:12 I’d forget the laptop and get a raspberry pi or similar that’s 24/7 to host it on. Nobody wants a blog etc that’s only randomly available. Use cloudflare to manage your domain and then something like ddclient to update ip if dynamic dns. It’s fairly straight forward with a little google fu. ---------------------------------------------------------------------- RedditSlayer2020 · 2023-12-20 23:23 They monetize your DATA and METADATA ---------------------------------------------------------------------- ericesev · 2023-12-20 23:27 All the free advertisement, like this comment thread, is likely good for them. ---------------------------------------------------------------------- BlazingBane007 · 2023-12-21 00:10 The laptop im using is setup for 24/7, cctv, no one touches it , i just remote dp into it for using. I already have one raspberry pi for my webpi and a few docker containers. Not gonna put any more load on that. You have any tips for me with WordPress self hosting? ---------------------------------------------------------------------- BlazingBane007 · 2023-12-21 00:21 You are right, my IP is not technically a cgnat, but my isp is kind of tier 3-4. That's the reason i use ngrok. But others are suggesting the cloudflare thing. I have to see what it has to offer ---------------------------------------------------------------------- BlazingBane007 · 2023-12-21 00:21 Can i host a WordPress site with that? ---------------------------------------------------------------------- fuzz_64 · 2023-12-21 00:53 That's what i use it for :) ---------------------------------------------------------------------- edwardthefirst · 2023-12-21 02:11 who doesn't ---------------------------------------------------------------------- BlazingBane007 · 2023-12-21 02:15 Man you are my saviour now, Thanks for tnhe information, last question, im collectly using the local wp thing which has this ngnix and what now, i dont know what do shoud i delete it and move to localhost xampp or, docker or can i work with this local wp, im confused with the option, i want to have google ads and https. i know you gave enough information. this is my last question. THANKS A LOT. ---------------------------------------------------------------------- fuzz_64 · 2023-12-21 02:19 They have a lot more pay for services. Content delivery networks, web application firewalls, captcha, load balancers, blocking bots and attackers, AI stuff. All sorts of goodies that are easy to get hooked on lol. ---------------------------------------------------------------------- borkode · 2023-12-21 06:38 Cloudflare is perfect for these cases and is very easy ---------------------------------------------------------------------- BlazingBane007 · 2023-12-21 06:39 Hi, i have successfully integrated cloudflare tunnel to my node server to see its working and it does!. But my WordPress still isnt working, it kust keeps loading dont know what went wrong ---------------------------------------------------------------------- Viper3120 · 2023-12-21 12:43 This shows how subjective "best" is ---------------------------------------------------------------------- fuzz_64 · 2023-12-21 14:59 xyz.local is likely coming from your computer's name and the dns server so that's not a problem in the big picture. You'll get that in virtual machines too. ​ You will also be able to pull up the site by the IP address of that computer. EG [192.168.100.50](https://192.168.100.50) (likely not that.. just a random example) ​ When the server is accessible from the Internet, it will be referenced by [yourdomain.com](https://yourdomain.com) instead of xyz.local, even though it's the same computer. I'm not strong in Docker so can't answer many questions there (I use Windows and IIS web server). The big difference between hosting directly on physical laptop vs in a virtual machine: Physical hardware works fine if your computer has limited resources. EG just 4GB of RAM or 4 cpu cores. Very difficult to host the main OS and a virtual machine with that. You can perform monthly backups by cloning your hard drive to a backup drive every month or with a free tool. Virtual machines can be backed up more easily and much more easily ported to other computers if you need to increase your hardware. The downside is they take up more resources so if you have a computer with just 4 cpu cores and 4gb of RAM then this will not be a good experience as the main OS and the virtual machine will only have access to about 1-2 cores and 1-2GB of RAM. Here's a video on how to create the Cloudflare account [https://www.youtube.com/watch?v=tO6hGLwe8Q8](https://www.youtube.com/ watch?v=tO6hGLwe8Q8) Once your site is linked to Cloudflare (may take 24 hours for everything to sync after you adjust name servers) then you can create and link your tunnel to your site. Here's a video on how to do that in Linux https://www.youtube.com/watch?v=eojWaJQvqiw ---------------------------------------------------------------------- Eirikr70 · 2023-12-21 15:20 According to the level of technical comfort that you seem to have, I would recommend that you connect NOTHING to the internet, since it will take little time before your server will be turned into a BAD BOT. Why don't you have your site hosted by a professional ? ---------------------------------------------------------------------- borkode · 2023-12-21 18:10 Hmm lets make sure you set it up correctly, I am going to assume that your domain name is [cutesquirrels.com](https://cutesquirrels.com) and the device that's the webserver has the local IP address of [192.168.1.10](https://192.168.1.10). 1. Go to Cloudflare panel, look for zero trust, click access and then tunnels 2. Click on the tunnel name that you created and click configure 3. Go to public hostname and make sure that the right hostname in this case its just gonna be [curesquirrels.com](https://curesquirrels.com) (no subdomains) and under the service should be [192.168.1.10](https://192.168.1.10) If the above is all correct then lets try some other troubleshooting steps: Do you access your website locally using something like [192.168.1.10/website](https://192.168.1.10/website)? then you gotta go to the configuration for your tunnel and make sure that you put 'website' as the path otherwise it won't work. Do you host Wordpress on some non-standard ports? Then that means that you have to add the port number to the IP address when you configure it, in this case lets say you hosted word press on port 90 then you'll have to say [192.168.1.10:90](https://192.168.1.10:90) and so on and so forth. Try these and if it doesn't help I'll try and assist you further