NetHost is a lightweight networking tool that leverages Serveo, enabling you to expose local servers to the internet effortlessly, without requiring router or firewall configuration.
Whether you’re a developer looking for quick web hosting or a hobbyist needing secure SSH access, NetHost makes networking simple and effective.
- Expose Local Services: Seamlessly expose HTTP, TCP, and SSH traffic from your local network to the internet for development and testing.
- Custom Web Hosting: Host web pages online with a custom subdomain. NetHost ensures your website stays live by periodically sending requests.
- Public SSH Server: Expose a local SSH server securely, allowing remote connections from any network.
- Network Flexibility: Run NetHost on one device to expose services running on another within the same local network.
-
Download the
.deb
FileFirst, download the
nethost_v*.*.*.deb
file from the GitHub repository. Or just use this wget command-
wget https://github.com/aviyall/NetHost/raw/refs/heads/main/nethost_v1.0.1.deb
-
-
Install the Package
Open a terminal and navigate to the directory where the
.deb
file is located. Then, run the following command:sudo dpkg -i nethost_v1.0.1.deb && sudo apt-get install -f
nethost <protocol> <hostname> <local_port> [subdomain/remote_port/alias]
-
<protocol>
(REQUIRED):- Choose the type of tunnel:
http
: Expose HTTP traffic.tcp
: Expose TCP traffic.ssh
: Expose SSH traffic.
- Choose the type of tunnel:
-
<hostname>
(REQUIRED):- Specify the target host:
lh
: Shortcut for localhost.- Public or local IP addresses or hostnames are also valid.
- Ensure no firewall restrictions on port 22 on the host machine.
- Specify the target host:
-
<local_port>
(REQUIRED):- Port on the host machine.
-
[subdomain/remote_port/alias]
(OPTIONAL):- For
http
: Specify a subdomain or leave blank for a random one. - For
tcp
: This field is treated as a remote port. If blank, a random port is assigned. - For
ssh
: This field is treated as an alias, This field is necessary.
- For
nethost http lh 8080
nethost http lh 8080 mysubdomain
nethost http 192.168.1.24 8080 mysubdomain
nethost tcp lh 1234
nethost tcp lh 1234 32545
nethost ssh lh 22 myalias
nethost ssh 192.168.35.21 22 myalias
- Provides a custom URL for your web services:
https://<subdomain>.serveo.net
.
- Recommended range for local port :
1024–65535
. - If the remote port is kept as
0
, Serveo assigns a random port. (better to use0
in most cases)
- For SSH tunnel to work local port should be
22
. - An alias is mandatory, allowing connections like:
ssh -J serveo.net user@myalias
- Ensure
curl
,ssh
, andawk
are installed. - For TCP tunnels,
ncat
(Netcat) is required. - Supported operating systems: Linux (any common distros).
- Network Issues:
- Automatically detects and waits for network reconnection, resuming tunnels afterward.
- Serveo Downtime:
- Detects Serveo unavailability and retries until the service is back online.
- Invalid Subdomain:
- Prompts an error if the chosen subdomain is unavailable.
- Long-Term Hosting: NetHost ensures reliability by sending periodic requests to keep the connection alive.
- Multi-Device Support: Use NetHost on one device to expose services hosted on another device in the same network.
Important
The script.sh
file is provided to help you understand the code and to encourage your contributions. After making changes, submit a pull request, and I will merge it into the main branch.
After a particular number of changes to this file a new version of this tool (nethost_*.*.*.deb
) will be released.
Tip
Instead of the keyword nethost
you can also use nhost
on the terminal.
lh
can be used for localhost
.