How to make your server app publicly accessible

Making self-hosted server publicly available
Share on Facebook icon Share on LinkedIn icon Share on Twitter icon

By running a home server, you will not surprise anyone today. Typical family has terabytes of media stored locally, students need to make websites for their projects and so on. Home servers have become a popular choice among those who want to protect their data, share files, synchronize devices, etc. In this article we will talk about deploying a home server and making it accessible from outside your local network.

However, before we start, lets answer the question: "Why do I need a home server?"

Whether you work from home, launch a start up, run a small business, or just have a number of smart devices in your apartment, you may consider having a home server for:

  1. Backup
  2. Secure data storage
  3. Web hosting
  4. Devices synchronization
  5. Private instant messaging

How to start

Many start up teams and small businesses now use home servers for their data storage, hosting and communication needs. High demand on home servers played a great role in hardware development. Most modern servers are designed and built with noise output in mind and can be placed anywhere in your home or office. Besides that, it should be small and compact, have built-in wireless connection and low power requirements.

To determine what type of server hardware you need, you should answer the following questions:

  • How many users will connect to my network?
  • How much storage space do I need?
  • Will I need a lot of processing power?

After selecting and installing the hardware you need to choose the operating system and the right software for your home server. Linux and Windows server operating systems are the most popular ones. About 70% of servers have Linux OS installed. It does not need many resources for running system applications as compared to Windows server and thus is more stable. However, if you are ready to pay for licenses and take advantage of a friendly GUI, then Windows server will meet your requirements. It has been around for quite a long time and proved its stability.

After choosing an operating system you need to decide which software to use. There are many market players such as Windows Home Server, Ubuntu Server Edition, Plex Media Server or Amahi Home Server. Some of them have paid versions and are easy to setup and use. However, if you want to go with a free version such as Ubuntu Server Edition, you need to have technical skills and be ready to setup everything manually and study documentation.

Sometimes even a regular computer with a regular (not server) operating system can be used to run server applications for private messaging or collaboration, media streaming, etc.

How to access your server application

There are three possible levels of server application access:

  • Just from the machine where the server app is running - this can be useful, for example, when you develop websites and want to test them locally before publishing.
  • From the intranet (local network, both wired and wireless) - this can be useful if you want the server applications to be reachable by people nearby, who have devices connected to your LAN or WiFi. But keep in mind that as soon as a device disables WiFi or connects to another network, connection to your server will be lost abruptly.
  • From anywhere in the world - this is the right choice if you want to use your server for hosting your publicly available personal website, controlling your smart home or using your media library from any location, setting up secure private messenger for your family or team, etc.

Depending on the access level you wish to have, different configuration is required for your server app, firewall, and router. But in any case you need to get IP address for your server app.

How to get IP address for your server application

If you want your server app to be accessible only from the computer where it is running, you should use IP address 127.0.0.1 which is reserved on computers for local servers.

If you want your server app to be accessible from your intranet, you need to use the private IP address assigned by router to the machine where the server app is running. Private IPs in local network usually have the following look: 192.168.Х.Х, 172.16.X.X, 10.0.X.X, 100.64.X.X.

Detailed instructions on getting your computer private (internal) IP address:

Please keep in mind that your computer private IP can be changed after the system restart or network reconnect. That's why we recommend to configure Address Reservation (or DHCP Address Reservation) in your router settings to permanently tie the specific private IP address to your machine.

If you want your server app to be accessible from anywhere, you need not only fix your machine private IP address with Address Reservation on your router, but also get it a static public IP address.

Public IP address is assigned to your router by your Internet service provider. Most IP addresses provided by ISPs are dynamic, static IPs are usually available for an additional fee. You need to check this with your ISP and purchase a static IP if you don't have one yet. This static IP will be used in settings of various server applications you install on your server machine.

There are several other ways to get a static IP:

  • By using 'localhost tunneling' service
  • Setup VPN via your router
  • Use dynamic domain provider

Firewall settings and port forwarding for your server app

Each server application running on your machine listens on its own port which is set when configuring the application. This way server apps don't get mixed up data from random client apps. Server apps can also use different types of protocols for transferring different kinds of data. For example, UDP protocol is mostly used for VoIP and broadcasting, while TCP can be used for messaging.

Depending on your server app desired availability, a number of additional actions are required to configure its port and protocols:

  • No additional actions needed if you want your server app to be available only from the machine where it is running.
  • To make your server app available from your intranet, you need to open the port and protocols this application is using in the server machine firewall.
  • To make your server app available from anywhere you need to additionally setup port forwarding in your router configuration. Port forwarding should be configured for all types of protocols your server app is using.

Virola Private Messenger - example of a server app setup

Let's take a look at Virola Messenger server app setup. This software offers private and group messaging, voice and video meetings, file sharing and collaboration, and can be used both as a corporate messenger or as an instant messaging internal tool for a family or a group of friends. Virola client apps can be installed on all major desktop and mobile platforms.

You can setup Virola server on Windows, Linux or macOS, no server OS is required.

Illustration of access to a web server from local computer, local network, public Internet

When running Virola server you'll need to specify its IP and port. For example:
virola_server_app.exe --listen 192.168.0.3:8888 --storage-dir C:\Virola\Server
where

  • 192.168.0.3 - the server machine private IP address
  • 8888 - the port Virola Server is listening on
  • C:\Virola\Server - a directory to store all the data transferred through Virola Server

If you have other server apps running on your machine, make sure that Virola Server port is not the same as the ports of other server apps. If Virola Server is the only server app you have, you can choose any port you wish.

Use the information provided in the article to choose the right IP for the server:

  • Using IP address 127.0.0.1 for Virola server, you will be able to connect Virola client only from the computer where Virola server is running
  • To make Virola accessible in your intranet, use private IP address assigned by the router to the machine where Virola server is running. Don't forget to open Virola port and both TCP and UDP protocols in the machine firewall, as Virola uses TCP for messaging and UDP for voice and video broadcasting.
  • If you want your Virola Private Messenger to be accessible globally,
    • get a static IP for your router from your ISP
    • fix a private IP for your computer in your router settings
    • open Virola port for both TCP and UDP protocols in your server machine firewall
    • enable port forwarding both for both TCP and UDP protocols in your router settings