<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Database connections using SSH workaround]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I have two cloudrons. I want to hook up nocodb on one to the postgres on the other.</p>
<p dir="auto">However, it appears that nocodb does not support database connections over ssh.</p>
<p dir="auto">Given that apps cannot "see" the machine host network, I can't use a port using an ssh tunnel on the server either.</p>
<p dir="auto">Any ideas on how to achieve this?</p>
<p dir="auto">I do have a VPN set up between the two cloudrons -- if there's a simple way of bridging the docker and vpn networks, that would suffice. (Admittedly, this would be unfamilair territory for me.)</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.cloudron.io/topic/10944/database-connections-using-ssh-workaround</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 06:31:47 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/10944.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Jan 2024 00:44:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Database connections using SSH workaround on Mon, 29 Jan 2024 14:43:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cdrm" aria-label="Profile: cdrm">@<bdi>cdrm</bdi></a> yes , additional databases are also excluded from backups.</p>
]]></description><link>https://forum.cloudron.io/post/82179</link><guid isPermaLink="true">https://forum.cloudron.io/post/82179</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 29 Jan 2024 14:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Mon, 29 Jan 2024 14:36:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> said in <a href="/post/82138">Database connections using SSH workaround</a>:</p>
<blockquote>
<p dir="auto">I guess socat is fine too if it works for your use case. Instead of creating a new postgres user, you can just use the database user which is created for nocodb. They are in the env vars of the apps - <a href="https://docs.cloudron.io/packaging/addons/#postgresql" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.cloudron.io/packaging/addons/#postgresql</a> . Note that when the postgresql database upgrades, your user will not be preserved since it is not part of any backup and cloudron has no idea about this user either (so, it's best not modify postgres).</p>
</blockquote>
<p dir="auto">Re database upgrades, are additional databases I create also excluded from backups?</p>
]]></description><link>https://forum.cloudron.io/post/82177</link><guid isPermaLink="true">https://forum.cloudron.io/post/82177</guid><dc:creator><![CDATA[cdrm]]></dc:creator><pubDate>Mon, 29 Jan 2024 14:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Mon, 29 Jan 2024 08:50:27 GMT]]></title><description><![CDATA[<p dir="auto">I guess socat is fine too if it works for your use case. Instead of creating a new postgres user, you can just use the database user which is created for nocodb. They are in the env vars of the apps - <a href="https://docs.cloudron.io/packaging/addons/#postgresql" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.cloudron.io/packaging/addons/#postgresql</a> . Note that when the postgresql database upgrades, your user will not be preserved since it is not part of any backup and cloudron has no idea about this user either (so, it's best not modify postgres).</p>
]]></description><link>https://forum.cloudron.io/post/82138</link><guid isPermaLink="true">https://forum.cloudron.io/post/82138</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 29 Jan 2024 08:50:27 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Sun, 28 Jan 2024 22:03:51 GMT]]></title><description><![CDATA[<p dir="auto">I restarted a couple of times and retried my setup again using my custom postgres user, and it's working now. But I'm not sure it will hold, it seemed to be flip-flopping between working and not working due to a security error. I am using Superset and Nocodb to test this out.</p>
<p dir="auto">To re-clarify the setup:</p>
<ul>
<li>
<p dir="auto">Use <a href="https://docs.cloudron.io/networking/#whitelist-ports" target="_blank" rel="noopener noreferrer nofollow ugc">this method</a> to whitelist an external port that will be exposed externally and connect to cloudron B postgres.<br />
E.g: 5555.</p>
</li>
<li>
<p dir="auto">Use <strong>socat</strong> to couple cloudron Bs postgres to the external port, as described <a href="https://forum.cloudron.io/post/6822">here</a>.</p>
</li>
<li>
<p dir="auto">Log into postgres and create a new user that, via assigning custom roles, has access to all the necessary custom databases (I don't know if this is recommended, so I'll omit details on what I did here exactly).<br />
E.g: my_user has access to db_1, db_2, db_3</p>
</li>
<li>
<p dir="auto">Go into the app and login with the cloudron B IP + external port + the custom db user + etc etc.</p>
</li>
</ul>
<p dir="auto">I will continue to test this out and post back if the errors come back again.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> I had tried the SSH tunnel method the other day, with no success, but it appears I should have been using the docker interface instead, as in your example. Is this method or the socat method more meaningfully preferred over the other?</p>
]]></description><link>https://forum.cloudron.io/post/82126</link><guid isPermaLink="true">https://forum.cloudron.io/post/82126</guid><dc:creator><![CDATA[cdrm]]></dc:creator><pubDate>Sun, 28 Jan 2024 22:03:51 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Sun, 28 Jan 2024 11:25:26 GMT]]></title><description><![CDATA[<p dir="auto">You shouldn't use root database user.</p>
<blockquote>
<p dir="auto">I have two cloudrons. I want to hook up nocodb on one to the postgres on the other.<br />
However, it appears that nocodb does not support database connections over ssh.</p>
</blockquote>
<p dir="auto">Since this gets asked often, I wrote a guide now on SSH tunnels - <a href="https://docs.cloudron.io/guides/ssh-tunnel/" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.cloudron.io/guides/ssh-tunnel/</a></p>
<p dir="auto">For example, you can set up a local forwarding tunnel from server A to server B with something like:</p>
<pre><code>/usr/bin/ssh -NT -L 172.18.0.1:4000:172.18.30.2:5432 root@server_b_ip
</code></pre>
<p dir="auto">If you run the above on server A, then nocodb on server A, can connect to server B's postgresql at port 4000 on IP 172.18.0.1 . 172.18.0.1 is the internal docker bridge IP, so it's quite secure.</p>
<p dir="auto">You can test the connection on Server A like:</p>
<pre><code>PGPASSWORD=65bd069b8997ed746665a2c84b2de9454d2976dab2bbfe811e34f193e8b7ce9c871b26f2644e15467f1aa4e963eafa0d740c65ee20b98f409acc22595f773bca psql -h 172.18.0.1 -p 4000 -U user8ad81c1740b9483391160eb14440a4f9 -d db8ad81c1740b9483391160eb14440a4f9
</code></pre>
<p dir="auto">(The values come from nocodb of server B. Do <code>env | grep POSTGRESQL</code> in the web terminal of the app)</p>
]]></description><link>https://forum.cloudron.io/post/82068</link><guid isPermaLink="true">https://forum.cloudron.io/post/82068</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Sun, 28 Jan 2024 11:25:26 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Sun, 28 Jan 2024 03:03:02 GMT]]></title><description><![CDATA[<p dir="auto">Just had an epiphany...</p>
<p dir="auto">I had to do create several roles to get the custom user and db working to circumvent the cloudron restrictions in place on the database:</p>
<pre><code># samerole specifies that the requested user must be a member of the role with the same name as the requested database
host samerole all 0.0.0.0/0 md5
</code></pre>
<p dir="auto">In light of this, I've just tried to log into root (after granting said roles), and it works. So the current issue is the cloudon database security, not the bridge -- that's progress.</p>
<ol>
<li>Does this post now go into another topic?</li>
<li>How to deal with the database user security stuff? I dont want to be using root.</li>
</ol>
]]></description><link>https://forum.cloudron.io/post/82031</link><guid isPermaLink="true">https://forum.cloudron.io/post/82031</guid><dc:creator><![CDATA[cdrm]]></dc:creator><pubDate>Sun, 28 Jan 2024 03:03:02 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Sun, 28 Jan 2024 02:49:17 GMT]]></title><description><![CDATA[<p dir="auto">I managed to find <a href="https://forum.cloudron.io/topic/2245/connect-minecraft-server-to-lamp-stack-s-mysql/8">this post</a> that sounds like what I'm trying to do, but I'm not able to get it to work. I get back the following error:</p>
<pre><code>(psycopg2.OperationalError) connection to server at "x.x.x.x", port 5555 failed: FATAL: no pg_hba.conf entry for host "172.18.0.1", user "my_user", database "my_db", no encryption (Background on this error at: https://sqlalche.me/e/14/e3q8)
</code></pre>
<p dir="auto"><strong>x.x.x.x</strong>: Either the origin IP or the VPN IP, both return the same error. Using the FQN doesn't work.<br />
<strong>Port 5555</strong>: The port I've established coupling to the internal postgres server<br />
<strong>user my_user and database my_db</strong>: I created a custom user and databas within the target cloudron postgres server (using root credentials).</p>
<p dir="auto">I found two pg conf file. The first one, in <strong>/var</strong>, I added an entry to temporarily whitelist all IPs for the user, to no avail. The second, in <strong>/etc</strong>, is not writable.</p>
<p dir="auto">Is the second causing the issue? Don't think it's possible to edit it as it's a mounted file.</p>
]]></description><link>https://forum.cloudron.io/post/82030</link><guid isPermaLink="true">https://forum.cloudron.io/post/82030</guid><dc:creator><![CDATA[cdrm]]></dc:creator><pubDate>Sun, 28 Jan 2024 02:49:17 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Sat, 27 Jan 2024 17:48:05 GMT]]></title><description><![CDATA[<p dir="auto">Have you searched the forum on how to do this? It's been mentioned before.</p>
]]></description><link>https://forum.cloudron.io/post/81991</link><guid isPermaLink="true">https://forum.cloudron.io/post/81991</guid><dc:creator><![CDATA[robi]]></dc:creator><pubDate>Sat, 27 Jan 2024 17:48:05 GMT</pubDate></item><item><title><![CDATA[Reply to Database connections using SSH workaround on Sat, 27 Jan 2024 21:40:31 GMT]]></title><description><![CDATA[<p dir="auto"><s>I have another issue that's possibly related.</s></p>
<p dir="auto"><s>I've used nocodb to connect to the local postgres. When I try to edit a table, I get the toast notification:</s></p>
<pre><code>Cannot read properties of undefined (reading 'column_name')
</code></pre>
<p dir="auto"><s>I'm unable to write any row data to the database table. I can add new columns to the table though.</s></p>
<p dir="auto">EDIT: Scratch this, I figured out including a primary key on the table avoids this error.</p>
]]></description><link>https://forum.cloudron.io/post/81973</link><guid isPermaLink="true">https://forum.cloudron.io/post/81973</guid><dc:creator><![CDATA[cdrm]]></dc:creator><pubDate>Sat, 27 Jan 2024 21:40:31 GMT</pubDate></item></channel></rss>