Question

Can't SFTP to an external server from DO Apps

Hi, I have some code that pushes content periodically to an sFTP server hosted on AWS. The sFTP server does not have any firewall setup or any restriction on who can connect.

When I run this code on my local docker image it works 100%.

I then provision my code on a DO App that uses the same docker image but then it doesn’t work anymore - it cannot send anything to the sFTP server.

What brings me to the DO Community is that I’m getting no logs - no connection rejected, just a time out.

So I was wondering if there’s any firewall setup pre-built in DO Apps or something because I’m really at a loss here.


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
January 18, 2024

Hi there,

This issue could be related to the DigitalOcean App Platform’s networking restrictions, particularly regarding outbound traffic.

On the DigitalOcean App Platform, outgoing traffic on port 22 (which is commonly used for SFTP and SSH) is not allowed. This restriction is likely causing the timeout errors you’re experiencing, as your app is unable to reach the external SFTP server on this port. A potential workaround for this limitation is to configure your external SFTP server to use a port other than 22, and then modify your application to connect to this new port.

However, it’s important to remember that the storage on the DigitalOcean App Platform is ephemeral. This means that any data stored on the app’s filesystem is not persistent and will be lost when the app is restarted or redeployed. Therefore, if your application relies on storing data that needs to persist, you’ll need to consider using external storage solutions or database services that are designed for data persistence.

Best,

Bobby

alexdo
Site Moderator
Site Moderator badge
January 18, 2024

Heya,

I believe that the SFTP protocol which uses SSH is not supported in app platform. Only TCP connections can be made external to app platform.

You can reach our to our support team and they can give you more information on this.

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel