SFTPGo is a lightweight, production-ready SFTP/FTP server that makes secure file sharing effortless.
More details https://sftpgo.com
Before you begin, ensure you have the following installed on your system:
- Docker (version 20.10+)
- Docker Compose (version 1.29+)
- Git (to clone repositories or download files)
- A Linux server (Ubuntu 20.04+ or CentOS 7+ recommended)
- Internet connection to download Docker images
docker --version
docker compose --versionIf not installed, follow the official Docker installation guide.
git clone https://github.com/wmo-raf/sftpgo.git
cd sftpgoCreate subdirectories for data persistence:
mkdir -p data/sftpgodata
mkdir -p data/sftpgohome
mkdir -p pg_dataYour directory structure should look like this:
sftpgo/
├── data/
│ ├── sftpgodata/
│ └── sftpgohome/
├── pg_data/
├── docker-compose.yml
└── .env
Create a file named .env in your sftpgo directory:
You can copy from the sample file
cp .env.sample .envUpdate the variables as required:
nano .envImportant: Set DB_PASSWORD with a strong password. Use a combination of:
- Uppercase letters (A-Z)
- Lowercase letters (a-z)
- Numbers (0-9)
- Special characters (!@#$%^&*)
Save the file (in nano: press Ctrl+O, then Enter, then Ctrl+X).
The configuration uses an external network. Create it with this command (use the NETWORK_NAME from your .env file):
docker network create <your_net>To verify the network was created:
docker network lsSet proper permissions for the data directories:
chmod 755 data/sftpgodata
chmod 755 data/sftpgohome
chmod 755 pg_dataNavigate to your project directory and start all services:
cd sftpgo
docker compose up -dThe -d flag runs containers in detached mode (background).
Monitor the startup process:
docker compose logs -fWait until you see messages indicating both services are running. Press Ctrl+C to exit the logs.
Check if both containers are running:
docker compose psExpected output:
CONTAINER ID IMAGE STATUS
xxxxx drakkan/sftpgo Up 2 minutes
xxxxx postgres:15 Up 2 minutes
Check the logs for any errors:
docker compose logs sftpgo
docker compose logs sftpgo-dbOpen your web browser and go to:
http://your-server-ip:8080
Replace your-server-ip with your server's actual IP address.
Default Admin Credentials:
- Username:
admin - Password:
password
- Log in with default credentials (admin/password)
- Go to "Admins" section
- Create a new admin account with a strong password
- Delete the default admin account
Your SFTPGo setup uses these ports:
| Port Range | Service | Purpose |
|---|---|---|
| 8080 | HTTP | Web administration interface |
| 2022 | SSH/SFTP | Secure file transfer (primary) |
| 2121 | FTP | File transfer protocol |
| 50000-50100 | FTP Passive | FTP passive mode data connections |
Ensure these ports are:
- Not blocked by firewall
- Open in your hosting provider's security groups
- Accessible from your network
docker compose downdocker compose up -ddocker compose restartdocker compose logs -f sftpgo
docker compose logs -f sftpgo-dbIssue: Cannot access web interface (http://ip:8080)
Solution:
- Check if containers are running:
docker-compose ps - Check firewall settings:
sudo ufw status - Allow port 8080:
sudo ufw allow 8080 - Check service logs:
docker-compose logs sftpgo
Solution:
- Verify .env file has correct values:
cat .env - Check database logs:
docker-compose logs sftpgo-db - Restart database:
docker-compose restart sftpgo-db
Solution:
sudo chown -R 1002:1002 data/sftpgodata
sudo chown -R 1002:1002 data/sftpgohomeSolution: Recreate the network using the name from your .env file (NETWORK_NAME):
docker network create sftpgo_network
docker compose down
docker compose up -d- Change default credentials immediately
- Use strong passwords (minimum 16 characters)
- Configure firewall to restrict access to necessary ports only
- Use SSH keys instead of passwords for SFTP access
- Enable defender (already enabled in this config)
- Keep Docker images updated:
docker compose pull docker compose up -d
- Monitor logs regularly for suspicious activity
- Use HTTPS with proper SSL certificates for web interface
docker compose pull
docker compose up -ddocker system prune -adf -h
du -sh *- SFTPGo Official Documentation: https://sftpgo.github.io/
- Docker Documentation: https://docs.docker.com/
- PostgreSQL Documentation: https://www.postgresql.org/docs/
- Create SFTP user accounts in the web interface
- Set directory quotas and permissions for users
- Configure backup strategy
- Set up monitoring and alerting
- Document all usernames and access credentials in a secure location