I have my backend application (App platform) and droplet with which I want to connect via ssh2 from my backend app. In development it works fine, but in production I have an error:
[2025-08-26 12:10:21] Custom crypto binding available
[2025-08-26 12:10:21] Local ident: 'SSH-2.0-ssh2js1.16.0'
[2025-08-26 12:10:21] Client: Trying 134.209.... on port 22 ...
[2025-08-26 12:10:41] [Nest] 17 - 08/26/2025, 12:10:41 PM ERROR [ExceptionsHandler] Error: Error loading and parsing properties file: Timed out while waiting for handshake
[2025-08-26 12:10:41] at BBBServerService.getConfig (/workspace/dist/src/modules/bbb/bbb-server.service.js:126:19)
[2025-08-26 12:10:41] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2025-08-26 12:10:41] at async BBBController.getConfig (/workspace/dist/src/modules/bbb/bbb.controller.js:52:28)
[2025-08-26 12:10:41] Socket closed
Any ideas how to fix this? I guess the problem is with my backend application? Some rules forbid this operation? What is the simplest way to fix that?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey Jaroslaw,
If I remember correctly on the App Platform, outbound connections to port 22 are blocked, which is why your SSH handshake is timing out.
One workaround is to configure your Droplet’s SSH service to listen on a different port (for example 2222).
Then update your firewall rules to allow access on that port, and point your backend app to connect there instead.
This not only bypasses the App Platform restriction but is also considered a bit more secure than leaving SSH exposed on the default port.
DigitalOcean has a guide on how to do that as well: https://docs.digitalocean.com/support/how-do-i-change-my-droplets-ssh-port/
This error usually means your SSH client can’t establish a connection to the server — it’s often caused by one of the following:
The port (usually 22) might be blocked by a firewall or not open on the server.
Check that the server is reachable and the port is open.
Use telnet your.server.ip 22 or nc -zv your.server.ip 22 to test.
The server might not have the SSH service (sshd) running.
If you have other access (e.g., console), check and start the service manually.
Double-check the hostname or IP you’re connecting to.
Ensure DNS is resolving correctly if using a domain.
Make sure you’re using the correct authentication method, port, and protocol version.
If you’re using an app platform (like a PaaS), verify that SSH access is enabled and configured correctly in the platform settings.
Some app platforms restrict SSH access or require specific keys or settings.
Check your app platform’s documentation for SSH access setup.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.