Categories
Networking Server SysAdmin

File Traefik

Serve files securely via SFTP, HTTPS, and WebDAV with SFTPGo proxied behind Traefik with Docker.

Configure

For the host’s side, let’s make our destination paths and set their ownership to the User and Group ID that SFTPGo uses:

{
    mkdir -pv /srv/sftpgo/{home,backups,config};
    chown -Rv 1000:1000 /srv/sftpgo/{home,backups,config};
}

Now, start the SFTPGo service, and if that’s successful, enable the service to start at system boot:

systemctl start docker-compose@sftpgo && systemctl enable docker-compose@sftpgo

You’re now ready to head to https://example.com/, in which case, Traefik will redirect you to the admin login screen at https://example.com/web/admin/login.

After creating your administrator account and logging in, you’ll be presented with the users’ screen where you can add, remove, or update user accounts for transferring files.

Click on Status to ensure that everything is running as expected.

To add or remove administrators you can make changes on the Admins screen. This is also where you can create administrative accounts for software that will drive SFTPGo via its Application Programming Interface (API) located at https://example.com/api.

Typically, I use Paw to work with APIs (mine or others’), sifted through SFTPGo’s schema on Stoplight, and was able to get requests working quickly.

The TL;DR is that you request a JWT with a username and password, and then use the JWT to make requests.

The Defender option is where you can manage IPs that have been blocked by SFTPGo, based upon criteria specified in docker-compose.yaml.

Please remember to enable Two-Factor Authentication!

3 replies on “File Traefik”

I always get this error:
middleware “bastion-hosts@file” does not exist

How can I fix this?

May I ask if you could explain a bit what Index is used for and why you would want to redirect these requests to the web interface for administrators instead of the web interface for clients?

Leave a Reply

Your email address will not be published. Required fields are marked *