I was recently searching for hosting services to use for my web app and found quite a few. However, all of them were paid services. Now, if you’re just starting and need a small server for your app, a few dollars a month won’t set you back, but later on, as your business grows, you’ll need dedicated servers to optimize performance and reduce cost.
You might think, “Alright! Dedicated servers sound great! They’ll save money and make my app faster!” They certainly will do that, but it comes at a price – large enterprise servers cost anywhere from tens of thousands to millions of dollars. That’s right, 7 digits. Now for you and me, we might not need the most expensive servers out there, but for more demanding applications that require large computational and processing power, everyday hosting services may no longer be enough.
But what’s the difference between a localhost connection and a live server? Well, localhost is primarily used by web developers to test out website elements such as HTML and CSS styling. However, you can only access localhost on your computer, not other ones on your network. Localhost connections are also usually primarily for UI testing; they don’t provide any real server functionality unless you specifically include server code in your application (for example, NodeJS).
If you want to try out a real, dedicated server for your app or website, which you can then use to access your website through any internet-connected device, you might have thought about using your computer as a server. This is a great option for testing out your application on a “live” server and seeing how it holds up in real-world conditions. It’s also a great way to find problems and other production-level issues you might not have otherwise caught.
You might not be able to use your homemade server in a production environment, but it’s a useful way to simulate one. So, how can we go about this, and what do we need to get started? A good computer is a must. Although you can certainly run a server on your laptop, it’s probably not the best idea as it might not be able to support apps that require heavy processing power and fast speeds.
If you have an older computer such as a decent PC that you don’t use anymore, it’s perfect for setting up a server. You’ll need to connect it to the internet and try to get 1:1 download to upload speeds, as this is essential for maintaining a speedy server. As for software, install a server hosting software, for example, Apache, and set it up. You might need to use a VPN, however, this isn’t necessary for setting up your server.
Once you’ve set up your server, you can enter localhost followed by the port name (ex: 3000) into your browser to access your live site. However, this is only available on your main device. If you want to access your app through other devices, you’ll need to enter the server IP address into the browser.
You can use your homemade server to test out your application. Make sure to look specifically for production-level issues that you might not have caught earlier. If you’re interested in actually using this homemade server to host your app worldwide, there’s a bit more work ahead. Also note that this is not recommended and you’re probably better off using a hosting service provider such as Render or Hostinger.
If you want to use your homemade server in production, you’ll need to make sure that it has a stable power source (backups are highly recommended), a large amount of speedy storage, at least 16GB of RAM, and a powerful processor capable of processing large amounts of information quickly. Remember, this is the computer that’s going to host your application worldwide, so invest more to make it production-ready.
I don’t think anyone wants to type 1:1173:7250:241 into their search bar, so you’ll need to connect a domain to your server. To do this, you’ll need to add the necessary SSL certificates and connect your registered domain from a provider like GoDaddy. I won’t go too in-depth here, but once your domain is connected, you’re ready to go live!
And there you have it. Using your personal computer as a server is a great way to test out a production environment for no cost, and allow other people on your network to try out your app. You can simulate a live server experience for your app, which is extremely useful when releasing a large, processing-power-heavy application. And if you want to go all in, you can use your computer as a production server, too.
See you next week! 👋

Leave a comment