# Home network: access a web server running as localhost from another computer

**URL:** <https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506>\
**Category:** Newbie\
**Created:** [July 1, 2020, 10:10pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506 "2020-07-01T22:10:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 1, 2020, 10:10pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/1 "2020-07-01T22:10:14Z")

</div>

Using EndeavourOS and trying to learn about stuff.

I have Hugo running on 192.168.1.137:1313 (using “hugo server”) and can access it on that computer. I try to access this address from another computer on the same network with a browser and get “connection refused”. I’ve turned off firewalls. I know that some servers don’t allow access from other computers, but I would like to learn more about how to debug this. From the second computer I tried:

`  
ping 192.168.1.137 and that was successful

then

nmap -p 1313 192.168.1.137

and got

1313/tcp closed bmc-patroldb  
`

Thanks

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [July 1, 2020, 10:24pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/2 "2020-07-01T22:24:17Z")

</div>

That really sounds like your Hugo server still has firewall enabled.  
Are you using ufw firewall?  
Command ifconfig shows ip addresses and masks (hope I remember that right, I’m not at a linux box now). Can you show that output here?

Another reason could be some misconfiguration of the server.

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 1, 2020, 11:52pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/3 "2020-07-01T23:52:21Z")

</div>

hi @manuel, yes, the server is Linux Mint 19.3 with ufw firewall, status currently off.  
Here is the ifconfig for the server, connected by ethernet cable. The client with EndeavourOS does not have a firewall as far as I can tell.

```auto
enp8s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.1.137 netmask 255.255.255.0 broadcast 192.168.1.255
        inet6 fe80::7d52:6b69:5a80:3926 prefixlen 64 scopeid 0x20<link>
        ether 60:02:92:3b:b0:4a txqueuelen 1000 (Ethernet)
        RX packets 8586342 bytes 11887697287 (11.8 GB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 4108223 bytes 537670071 (537.6 MB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
        device interrupt 18  

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Local Loopback)
        RX packets 101699 bytes 21498842 (21.4 MB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 101699 bytes 21498842 (21.4 MB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
        inet 10.25.10.6 netmask 255.255.255.255 destination 10.25.10.5
        inet6 fe80::9a90:b7ce:1dad:85dd prefixlen 64 scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100  

(UNSPEC)
        RX packets 21833 bytes 26627267 (26.6 MB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 14571 bytes 1427670 (1.4 MB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

```

Doing this, have just realised that both client and server have Private Internet Access running and that may be a factor, but have disconnected both and tried to access the server with the same result.

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 1, 2020, 11:56pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/4 "2020-07-01T23:56:57Z")

</div>

### Here is the client side picture

 ![Screenshot_2020-07-02_00-53-18](https://forum.endeavouros.com/uploads/default/original/2X/6/6812f57b93f98909a47799ca7a5fbc58237aacfc.png)

---

<div class="post-metadata">

**Author:** ![Pudge](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pudge/32/17155_2.png) [@Pudge](https://forum.endeavouros.com/u/Pudge)\
**Post date:** [July 1, 2020, 11:58pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/5 "2020-07-01T23:58:19Z")

</div>

What protocol are you using to access the server, ssh?

Pudge

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 2, 2020, 12:04am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/6 "2020-07-02T00:04:20Z")

</div>

Hi @Pudge

Here is what the access looks like from a browser on the server, so would that be http/https?

![Screenshot from 2020-07-02 01-00-38](https://forum.endeavouros.com/uploads/default/original/2X/b/bc5ae08583255583d6d92e7fa61efcd890d8cbff.png)

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 2, 2020, 12:07am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/7 "2020-07-02T00:07:49Z")

</div>

I can ssh into the server 192.168.1.137 from the client.

---

<div class="post-metadata">

**Author:** ![Pudge](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pudge/32/17155_2.png) [@Pudge](https://forum.endeavouros.com/u/Pudge)\
**Post date:** [July 2, 2020, 12:21am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/8 "2020-07-02T00:21:19Z")

</div>

First off, I have never connected to another computer (server) using localhost, so I am not familiar with how to do that. [Here is a web site that discusses the basics of localhost](https://www.hostinger.com/tutorials/what-is-localhost)

SSH is usually used to share files or communicate with other computers on a network, NFS can be used to share files, but I prefer SSH.

If you want to learn about stuff. here are some instructions about using SSH to communicate and transfer files that I wrote.  
[server instructions](https://github.com/pudges-place/EndeavourOS-ARM/blob/master/EOS-server-instructions.pdf)  
click on download and it will download to the folder specified in your browser.  
SET UP A LINUX CLIENT COMPUTER on page 7 might be of interest.  
HTH, have fun.  
Pudge

---

<div class="post-metadata">

**Author:** ![Pudge](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pudge/32/17155_2.png) [@Pudge](https://forum.endeavouros.com/u/Pudge)\
**Post date:** [July 2, 2020, 12:27am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/9 "2020-07-02T00:27:57Z")

</div>

Nevermind, I got the cart before the horse again. I should have looked up Hugo Server first, then replied. I just assumed Hugo server was a file server. Ooops, “hugo server, A high performance webserver Synopsis Hugo provides its own webserver which builds and serves the site.”

Sorry, not familiar with Hugo.

Pudge

Edit: I am starting to get what you are doing. You said:  
I have Hugo running on 192.168.1.137:1313 (using “hugo server”) and can access it on that computer.  
You can do this with localhost, and proves the hugo server is working by creating a local loopback to test the server without going out on a network.

You can’t go to a different computer and connect to the hugo server using localhost because that computer is only talking to itself with localhost. Does that make sense?

To connect to the Hugo server from another computer, you will have to specify it’s address in the client browser. http and https are usually on ports 80 and 435 respectfully. So in the client computer you would have to enter  
192.168.1.137:1313 as the URL not localhost. Not sure how it will react on port 1313.

Pudge

---

<div class="post-metadata">

**Author:** ![anon31549144](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@anon31549144](https://forum.endeavouros.com/u/anon31549144)\
**Post date:** [July 2, 2020, 7:54am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/10 "2020-07-02T07:54:35Z")

</div>

OP’s pretty much doing exactly that:

> [@Home network: access a web server running as localhost from another computer](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/4):
>
> Here is the client side picture [Screenshot\_2020-07-02\_00-53-18]

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 2, 2020, 7:56am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/11 "2020-07-02T07:56:58Z")

</div>

hi @Pudge

Reading your links…

So, a server that is configured to localhost can **never** be reached by an outside client, if I understand your points.

## option 1

Here is the hugo server documentation. Might it possible to configure **[hugo](https://gohugo.io)** to be accessible from an outside client on the same network?

```auto
hugo help server
Hugo provides its own webserver which builds and serves the site.
While hugo server is high performance, it is a webserver with limited options.
Many run it in production, but the standard behavior is for people to use it
in development and use a more full featured server such as Nginx or Caddy.

'hugo server' will avoid writing the rendered and served content to disk,
preferring to store it in memory.

By default hugo will also watch your files for any changes you make and
automatically rebuild the site. It will then live reload any open browser pages
and push the latest content to them. As most Hugo sites are built in a fraction
of a second, you will be able to save and see your changes nearly instantly.

Usage:
  hugo server [flags]

Aliases:
  server, serve

Flags:
      --appendPort append port to baseURL (default true)
  -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/
      --bind string interface to which the server will bind (default "127.0.0.1")
  -D, --buildDrafts include content marked as draft
  -E, --buildExpired include expired content
  -F, --buildFuture include content with publishdate in the future
      --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
      --cleanDestinationDir remove files from destination not found in static directories
  -c, --contentDir string filesystem path to content directory
  -d, --destination string filesystem path to write files to
      --disableBrowserError do not show build errors in the browser
      --disableFastRender enables full re-renders on changes
      --disableKinds strings disable different kind of pages (home, RSS etc.)
      --disableLiveReload watch without enabling live browser reload on rebuild
      --enableGitInfo add Git revision, date and author info to the pages
      --forceSyncStatic copy all files when static is changed.
      --gc enable to run some cleanup tasks (remove unused cache files) after the build
  -h, --help help for server
      --i18n-warnings print missing translations
      --ignoreCache ignores the cache directory
  -l, --layoutDir string filesystem path to layout directory
      --liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1)
      --meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
      --memstats string log memory usage to this file
      --minify minify any supported output format (HTML, XML etc.)
      --navigateToChanged navigate to changed content file on live browser reload
      --noChmod don't sync permission mode of files
      --noHTTPCache prevent HTTP caching
      --noTimes don't sync modification time of files
      --path-warnings print warnings on duplicate target paths etc.
  -p, --port int port on which the server will listen (default 1313)
      --renderToDisk render to Destination path (default is render to memory & serve from there)
      --templateMetrics display metrics about template executions
      --templateMetricsHints calculate some improvement hints when combined with --templateMetrics
  -t, --theme strings themes to use (located in /themes/THEMENAME/)
      --trace file write trace to file (not useful in general)
  -w, --watch watch filesystem for changes and recreate as needed (default true)

Global Flags:
      --config string config file (default is path/config.yaml|json|toml)
      --configDir string config dir (default "config")
      --debug debug output
  -e, --environment string build environment
      --ignoreVendor ignores any _vendor directory
      --log enable Logging
      --logFile string log File path (if set, logging enabled automatically)
      --quiet build in quiet mode
  -s, --source string filesystem path to read files relative from
      --themesDir string filesystem path to themes directory
  -v, --verbose verbose output
      --verboseLog verbose logging

```

## option 2

hugo can generate html etc for a _static website_. If I do that would there be a different way to make that website accessible to a client on the same network? There would be no PHP or SQL involved.

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 2, 2020, 9:04am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/12 "2020-07-02T09:04:39Z")

</div>

Just tried a simple version of option 2, so installed apache2 on the server, then a browser on the server with address _localhost_, and this gets the apache2 default page.

Then on the client on the same network, _[http://192.168.1.137](http://192.168.1.137)_ gets the same page.  
Server Firewall and PIA are all active.

This must all be on default port 80.

A small

> woohoo!

might be permitted here, before working out how to get apache2 to serve the hugo web pages, and why hugo server won’t do the same.

---

<div class="post-metadata">

**Author:** ![anon31549144](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@anon31549144](https://forum.endeavouros.com/u/anon31549144)\
**Post date:** [July 2, 2020, 10:45am UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/13 "2020-07-02T10:45:37Z")

</div>

You might want to check the firewall in the router also. Maybe disable it completely first. port 80 is open by default usually, that’s why you might have had results with apache. Also, it’s worth checking in the config files of hugo if it is set to accept external requests (in case there is such a setting).

---

<div class="post-metadata">

**Author:** ![Pudge](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pudge/32/17155_2.png) [@Pudge](https://forum.endeavouros.com/u/Pudge)\
**Post date:** [July 2, 2020, 12:45pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/14 "2020-07-02T12:45:47Z")

</div>

I know just a little pinch of nothing about Hugo server. For my edification, what are you trying to accomplish with Hugo server? I’m not asking that to be snarky, I am just seeing this as an opportunity for me to learn something.

If the goal is to have a public static web server, my suggestion would be to [explore all your possibilities and check out nginx](https://serverguy.com/comparison/apache-vs-nginx/).

[Here is my web server using nginx if you want to check nginx out.](https://pudges-place.ddns.net/)  
But a public static web server may not even be what you are trying to do.

Pudge

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 2, 2020, 12:57pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/15 "2020-07-02T12:57:29Z")

</div>

First time looking at setting up a website, so have to buy a domain, hosting, and work out how to setup the web pages and maintain them. It will be blog style with a few pages for about, contact, etc.

This is an example:

> **[Terminal](https://hugo-terminal.vercel.app/)**
>
> A simple, retro theme for Hugo

and here are the details:

> **[terminal](https://themes.gohugo.io/hugo-theme-terminal/)**
>
> Terminal DEMO - https://hugo-terminal.now.sh/ Features Built-in shortcodes Code highlighting How to start How to run your site How to configure Post archetype Add-ons How to (safely) edit the theme Found a bug? New cool idea or feature Terminal theme...

There are lots of themes available.

The idea of a static website (meaning pages are prebuilt, rather than PHP/SQL) so faster, less to go wrong. Have looked at [wordpress.org](http://wordpress.org) and other website generators.

The biggest hurdle seems to be understanding networking, so a parameter that’s obvious is easy to miss for me. Have now got access from a client to the server running apache2 only, but the website looks different… ![Screenshot from 2020-07-02 01-00-38](https://forum.endeavouros.com/uploads/default/original/2X/b/bc5ae08583255583d6d92e7fa61efcd890d8cbff.png) via localhost and the same home page from the client

![Screenshot_2020-07-02_12-24-53](https://forum.endeavouros.com/uploads/default/original/2X/7/7944ce7ec83b668579447b735f86e84d7f25a243.png)

Actually, just checked again, and this wrong rendering happens on localhost as well, so something is different between how hugo server renders the content versus how apache2 renders it. It must be an obvious error on my part.

Will certainly look at nginx as well.All good learning exposure.

---

<div class="post-metadata">

**Author:** ![Pudge](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pudge/32/17155_2.png) [@Pudge](https://forum.endeavouros.com/u/Pudge)\
**Post date:** [July 2, 2020, 1:24pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/16 "2020-07-02T13:24:27Z")

</div>

> [@ososos](#):
>
> First time looking at setting up a website, so have to buy a domain, hosting, and work out how to setup the web pages and maintain them. It will be blog style with a few pages for about, contact, etc.

I understand. Apache and nginx are general purpose web servers that are a base from which you can design a web page using HTML to be whatever you want. Hugo is designed to be a specific type of server for setting up blog type web pages. Hugo takes care of a lot of the ground work allowing you to concentrate on the blog’s content. I think I have that right. Cool.

In regards to hosting, have you considered hosting the blog yourself? In my case, the web server for my web site sits in my utility room on a shelf, and I use a Dynamic DNS service. Of course this option depends on how much traffic you expect on your site, and what restrictions your ISP provider has or doesn’t have. For Dynamic DNS, I use [https://www.noip.com/remote-access](https://www.noip.com/remote-access) and it costs me $25 a year. If you expect high traffic on the site, you’re best off using a hosting service.

Pudge

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 2, 2020, 1:26pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/17 "2020-07-02T13:26:30Z")

</div>

There is a setting called

> baseURL =

which needs to be set in the config, which I found when inspecting page source between the properly rendered and improperly rendered pages.

Once set to 192.168.1.137 I can access the rendered web pages from another client computer.

Now to learn more about nginx.

Thanks for your pointers!

---

<div class="post-metadata">

**Author:** ![Pudge](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pudge/32/17155_2.png) [@Pudge](https://forum.endeavouros.com/u/Pudge)\
**Post date:** [July 2, 2020, 1:39pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/18 "2020-07-02T13:39:31Z")

</div>

I don’t know if this will help or not.  
[hugo - getting started](https://gohugo.io/getting-started/configuration/)

Pudge

---

<div class="post-metadata">

**Author:** ![ososos](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@ososos](https://forum.endeavouros.com/u/ososos)\
**Post date:** [July 2, 2020, 1:57pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/19 "2020-07-02T13:57:25Z")

</div>

Thanks! Just going to have another look at it. Will certainly look into self hosting. Have never bought a domain, but from a learning perspective, self hosting something would make sense, but for a test, would a domain name be needed or could it be done with an ip address.

---

<div class="post-metadata">

**Author:** ![Pudge](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pudge/32/17155_2.png) [@Pudge](https://forum.endeavouros.com/u/Pudge)\
**Post date:** [July 2, 2020, 2:05pm UTC](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506/20 "2020-07-02T14:05:50Z")

</div>

> [@ososos](#):
>
> but for a test, would a domain name be needed or could it be done with an ip address.

Yes, for testing within your LAN an IP address will work fine. The host computer should be set up with a static IP address for best results. Down the road, if you want to provide access to the web server from the internet, you will have to look into port forwarding in your router. Don’t make it available to the world without port forwarding.

Pudge

[Next page](https://forum.endeavouros.com/t/home-network-access-a-web-server-running-as-localhost-from-another-computer/5506.md?page=2)
