Tried to change port from 1787 to 80

I wanted to change my running PhotoStructure (PS) for server installation on Ubuntu (nodes version) to be accessible on port 80 instead of 1787 (which is probably a bad idea already) and I can’t now revert it back.

Here is what I did to screw it up:

  • stopped PS
  • plugged PS_HTTP_PORT=80 line into ~/.profile right under PS_EXPOSE_NETWORK_WITHOUT_AUTH=“true” (which works great, btw)
  • source ~/.profile
  • started PS.
    Attempted to access PS on LAN IP with port 80 - does not work, w/o port - same.

Attempt to revert back to 1787:

  • stopped PS.
  • take out PS_HTTP_PORT=80 from ~/.profile
  • source ~/.profile
  • started PS
    got PhotoStructure is ready: http://localhost:1787/
  • attempted to access PS on LAN IP:1787 - no go. :frowning:

I also explicitly plugged PS_HTTP_PORT=1787 into ~/.profie, sourced it and started PS, same.

Did I break it for good? :frowning: Thanks God this is not “production” version 1.0 running for my family (which I can’t wait to get my hands on)!


Only the root user can bind to port 80 (or any port less than 1024)

You can use a reverse proxy to route PhotoStructure’s port to 80 (so PhotoStructure doesn’t have to run as root, which would be a bad idea).

This should work on Ubuntu:

sudo apt install socat
sudo socat TCP-LISTEN:80,fork TCP:

Note that something may already be bound to that port (if you had previously installed nginx or apache2).

You’ll need to figure out how to run this on reboot (if you’ve got an /etc/rc.local you could plop it into there).

You could also use setcap, but you’d have to authorize the node binary to bind to port 80, which would let any node script on your box to bind to privileged ports, and that’s not a great idea.

Thanks. Now I just need to bring PS back on 1787 port. Any idea how to do this without reinstalling PS?


Unsetting your environment variable should be enough to reset to defaults.

If it doesn’t, check your system settings:

That’s what I thought.

Checked ~/.config/PhotoStructure/settings.toml and the only four option that uncommented are:

copyAssetsToLibrary = false
libraryPath = “/home/photostructure/Pictures”
scanAllDrives = false
scanPaths = [

Then I tried to see what shell variables are set with ~/.config/PhotoStructure$ ( set -o posix ; set ) | less | grep ‘PS_’ and I got only this:


I don’t want to waste anyone’s time here, especially if nobody else saw this. I can redo my PS installation and library, as this screwup on my side.


That all looks totally reasonable. Once I get the alpha of v1 out, let’s try it with that.

Pulled alpha.2. PS started and I can access it from the host’s web browser on localhost:1787. Can’t from any other machine on LAN. Checked both library setting in

$grep exposeNetworkWithoutAuth ~/.config/photostructure/settings.toml | grep -v '#'
exposeNetworkWithoutAuth = "true"


$( set -o posix ; set ) | less | grep ‘PS_’

Sigh… Time for me to redo it again? :frowning:

I suspect you’ve got a firewall setting gumming up the works.

If you go into an empty directory in a terminal and run npx serve, can you open that public IP address on your other LAN boxes?

Here’s an example run:

$ npx serve
Need to install the following packages:
Ok to proceed? (y) y

   │                                               │
   │   Serving!                                    │
   │                                               │
   │   - Local:            http://localhost:5000   │
   │   - On Your Network:   │
   │                                               │
   │   Copied local address to clipboard!          │
   │                                               │

And then ctrl-c to stop the server

I don’t know whats happening or if this is relevant, but if you want to be able to access it from anywhere securely, you can use cloudflared tunnel with cloudflare teams.

Thanks for the suggestion, @Saxo_Broko !

By using cloudflare teams with cloudflared its already behind authentication, and cloudflared keeps the ip hidden.

1 Like

oh daaaang that’s nice! I’ll fix my prior comment.

I also just saw that Cloudflare teams has a generous free tier that would totally work for most users for family sharing.

Yes, I was able to get to my PS host ip using port 5000. Got directory listing.

@Const this should work: please send me debug logs from your web service starting up.

What could be a reason why I don’t see logs here ~/.config/photostructure/logs anymore? I see PS is running. Logs set to “debug” in settings.toml

~/.config/photostructure$ grep ‘log’ settings.toml | grep -v ‘#’
logLevel = “debug”

But ~/.config/photostructure/logs has only entries from few days ago…

Sorry about that: the alpha.1 build changed the config to lowercase, but alpha.2 restored it back to .config/PhotoStructure:

Oddly settings.toml is in uppercase dir, but logs are still pouring into lower case dir. I replied to support email address with logs location.

Thank again! Please don’t raise priority of this, as it feels like very isolated issue. After all I can redo PS installation again.

Update: we realized his editor was adding a BOM to his settings.toml, which prevented node from parsing the contents.

PhotoStructure’s next build has BOM detection for UTF-8 and UTF-16 (LE).

1 Like

Thanks for the update and the fix. It seems non trivial to check what BOM bit a file has. I don’t think plain Ubuntu 20 vi is adding anything fishy to my files and the problem was intermittent.


On Linux, I’d probably use something like

hd file | head -n1

and check the first bytes. Wikipedia has a table of BOM values.

1 Like