On ruachost.com, you can connect to your PostgreSQL databases remotely from your local computer. This allows you to manage data using client applications such as psql, pgAdmin, or programming libraries.
???? Important Prerequisite
Before you can establish a remote connection, you must open a support ticket Provide:
-
The name of the PostgreSQL database you want to access remotely.
-
The database username.
-
The IP address from which you will connect.
Ruachost support will then enable remote access for your database.
Methods to Connect Remotely
Method 1: Secure SSH Tunnel (Recommended)
An SSH tunnel encrypts traffic between your local computer and the PostgreSQL server.
On Windows (using PuTTY):
-
Download and open PuTTY.
-
In Category → Connection → SSH → Tunnels, set:
-
Source port:
5432(or another local port if 5432 is already in use). -
Destination:
localhost:5432. -
Select Local and Auto.
-
Click Add.
-
-
In Session, enter your server’s domain or IP, and set Port to
22(or the custom SSH port, e.g.,7822). -
Save and open the session.
-
Log in with your Ruachost username and password.
-
Once connected, the tunnel is active. You can now use
psqlor pgAdmin locally with hostlocalhostand port5432.
On macOS/Linux:
Run in terminal:
Bash
ssh -p 7822 username@example.com -L 5432:localhost:5432
-
Replace
7822with your SSH port if different. -
Replace
usernameandexample.comwith your Ruachost credentials.
Method 2: Direct Connection (Less Secure)
You can connect directly to the PostgreSQL server if remote access is enabled.
-
Open your PostgreSQL client (e.g., pgAdmin, psql).
-
Enter the following connection details:
-
Host:
yourserver.ruachost.com -
Port:
5432 -
Database name:
dbname -
Username:
dbuser -
Password:
dbpassword
-
Example: Using psql
Bash
psql -U dbuser -h yourserver.ruachost.com -p 5432 dbname
Tips
|