Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jakethedog's avatar

Forge Server connect SQL remotely

Hi!

So I'm completely new to laravel and forge etc and I have no idea how I'm supposed to connect remotely. I've spoken with their support but they seem pretty uninformed besides from telling me that they require SSH to connect.

My problem is this; My webserver with the laravel app can connect to the DB fine because its local however I also have software which is supposed to connect to the DB and do a check of certain columns in the user table basically.

Typically the software works fine however since using Forge to provision the server because they have locked it off to only accepting SSH connections my software can no longer connect to the server.

I've been googling and supposedly I need to open an SSH Tunnel and then I should be able to connect through localhost instead of remotely however I'm not really sure the exact steps required for this.

To make things easier for myself I opened up a webserver on my local machine and made a test.php file where I tried to connect to MySQL on the AWS/Forge provisioned server.

Even following several tutorials and following countless comments and peoples advice I still haven't been able to successfully open an ssh tunnel which would allow me to connect to my DB.

Is it possible/known how to remove these restrictions that Forge have put on the server?

I almost wonder what would be more secure, removing the SSH restrictions and going back to the standard way of connecting or keeping it as is and figuring out how to open a ssh tunnel.

(The software will be distributed so if my understanding of ssh tunnel is correct I'd need to provide the .pem keyfile aswell which would allow anyone to gain access to my DB &/or server if obtained and they know what they are doing, no?)

Thanks in advance for your help! :)

0 likes
2 replies
Tray2's avatar

I would not disable any of the security measurs that is in place.

Not entierly sure what you are trying to do with "checking values" but I would create an API that I can use to retrieve the desired information.

jakethedog's avatar

@TRAY2 - Software includes a license check which needs to verify columns in the user table in the database...

The software needs to be able to communicate with the server for this unfortunately!

Thanks for the suggestion though, Brad

Please or to participate in this conversation.