Disclaimer: I am still fairly an IT newbie and have been doing self-studies around web development. I decided to take the path of remote development.
After some research, I came up with this configuration:
- remote: VPS (provided by an ISP) with a LAMP stack,
- local: VS Code with Remote SSH extension to be able to edit the website code on the VPS,
- Ubuntu 20.04 LTS on both systems.
My question now is: what do I need to do to make this whole configuration private (i.e. not accessible by the public)? What would be the best practice?
I cannot configure the VPS firewall to only let connections from my IP through since it is not static. Thus, I would need to adjust my firewall rule daily which can't be the best solution.
After some more research, I came across using a VPN. But I am not really familiar with that and it might be overkill for my case? Is having a VPN installed on the same VPS that I am using for web development even a good idea?
Then, I read something about SSH Port Forwarding. Would this be the best approach? If I understood correctly, this would enable me to forward a (localhost) port on my local computer to a (localhost) port on the remote VPS. As a result I could type in "127.0.0.1:80" in the browser on my local computer and I should be able to see the web page which resides on the remote VPS. Would this SSH port forwarding still work if I configured the VPS firewall to block all connections (except SSH port 22) to prevent any public access to the remote VPS (website, database etc.)?
Basically, I am wondering what the best and easiest approach is to make development on a remote VPS completely private (as if that public VPS was located in my own home and not accessible to anyone but me).
Thank you in advance for any response.