When I was using the non-pro version of TinyPilot, I could use tinypilot_external_port: in settings.yaml to specify the port.
I tried that with TinyPilot Pro and it doesn't seem to work.
I added that to my settings, then ran the install script again:
/opt/tinypilot/scripts/upgrade && sudo reboot
and after the Voyager came back up , I can still access the GUI using port 80 and can't using the port after tinypilot_external_port
Linked from:
- CCharles Hague @cghague2022-12-12 15:01:19.092Z2022-12-20 17:49:36.438Z
Hi Alan - thanks for your great question on changing the port TinyPilot listens on!
You are correct that you need to modify
settings.yml
. However, if you're already on the most recent version of TinyPilot Pro then you'll need to force the update process to run in order for the changes to be picked up.I've put together a short shell snippet that will do this for you. To get started, connect via SSH and run the following commands to specify the required ports:
NEW_EXTERNAL_HTTP_PORT=80 NEW_EXTERNAL_TLS_PORT=443
Once you've done that simply run the following snippet to apply the changes:
sudo sed --in-place '/tinypilot_external_port/d' \ /home/tinypilot/settings.yml && \ sudo sed --in-place '/tinypilot_external_tls_port/d' \ /home/tinypilot/settings.yml && \ echo "tinypilot_external_port: ${NEW_EXTERNAL_HTTP_PORT}" \ | sudo tee --append /home/tinypilot/settings.yml && \ echo "tinypilot_external_tls_port: ${NEW_EXTERNAL_TLS_PORT}" \ | sudo tee --append /home/tinypilot/settings.yml && \ sudo cp --no-clobber /opt/tinypilot/VERSION /opt/tinypilot/VERSION.bak && \ echo "2.4.0" | sudo tee /opt/tinypilot/VERSION && \ sudo /opt/tinypilot-privileged/update && \ sudo mv --force /opt/tinypilot/VERSION.bak /opt/tinypilot/VERSION
After the update process completes (which may take a little while) TinyPilot Pro will be listening on the new ports.
- MIn reply tomikerotch⬆:Alan Chiu @mikerotch
Thanks, this worked. If I use the GUI to upgrade Tinypilot, do I still have to run the script you provided after the upgrade? Or will the ports stay the same until I run the commands:
export NEW_EXTERNAL_PORT=80
export NEW_EXTERNAL_TLS_PORT=443again?
- CIn reply tomikerotch⬆:Charles Hague @cghague2022-12-12 23:05:32.531Z
The variables
NEW_EXTERNAL_PORT
andNEW_EXTERNAL_TLS_PORT
are temporary and are only used when the above script is being ran. The script writes the actual changes to/home/tinypilot/settings.yml
which means they will persist through updates, including those triggered from the web interface.