Running Buru SFTP Server in Docker

Rebex Buru SFTP Server can run natively in Windows Docker images, e.g. Nano Server.

Use portable edition, make any adjustments to the configuration files, add a license. Then copy the server to the Docker image.

You can use the following bash / fish shell script as a starting point.

The example generates the server keys before the docker image is created. If you wish to deploy on multiple servers, be sure to generate the server keys for each server separately, for example on container startup.

# This example will use C:\demo
mkdir /c/demo
cd /c/demo

# Download and unzip the portable edition
mkdir burusftp && cd burusftp
wget -qO- | bsdtar -xvf-
cd ..

# Create Dockerfile
echo > Dockerfile '
ENTRYPOINT ["burusftp.exe", "run"]
COPY burusftp /app'

# Create SFTP user data directory
mkdir userdata

# Initialize Buru SFTP Server
./burusftp/burusftp.exe init

# Build and run docker image
docker build -t buru-app .
docker run -d -p 22:22 --name buru --mount 'type=bind,src=C:\demo\userdata,dst=C:\userdata' buru-app

# Add user in running container
docker exec buru 'C:\app\burusftp.exe' user add guybrush --password elaine --root-dir 'C:\userdata\guybrush'
mkdir userdata/guybrush
touch userdata/guybrush/hello_elaine

# Force fingerprint renewal
ssh-keygen -R localhost

# Connect to Buru SFTP Server running in docker (use 'elaine' as password)
ssh guybrush@localhost

# Show contents of Guybrush's home directory - it should display 'hello_elaine' file created earlier 

# Stop and delete the container
docker stop buru
docker rm buru