GitHub avatar

Fox's Blog

← Back to projects

ubuntu-fox

Preconfigured Ubuntu Docker image for local SSH access and Cloudflare tunnel (cloudflared).

Prebuilt version (Docker Hub)

Image available here: https://hub.docker.com/r/fox3000foxy/ubuntu-fox

Pull the prebuilt image

docker pull fox3000foxy/ubuntu-fox:latest

Quick run (local SSH)

docker run -d \
  --name cloud-ubuntu \
  -p 22:22 \
  fox3000foxy/ubuntu-fox:latest

Run with Cloudflare tunnel

docker run -d \
  --name cloud-ubuntu \
  -e CDF_HOST="cloud.your-domain.tld" \
  -e CDF_TOKEN="<YOUR_CLOUDFLARED_TOKEN>" \
  fox3000foxy/ubuntu-fox:latest

Project structure

  • Dockerfile :
    • Installs utility packages (htop, nano) and openssh-server.
    • Installs cloudflared.
    • Configures SSH for password authentication.
    • Creates /usr/local/bin/start.sh to start sshd and (optionally) the Cloudflare tunnel when CDF_HOST and CDF_TOKEN are set.
  • README.md: usage, build, run, and Docker Hub publishing documentation.

Build the image

docker build -t ubuntu-fox:latest .

Run the container

Local SSH only mode

docker run -d \
  --name cloud-ubuntu \
  -p 22:22 \
  ubuntu-fox:latest

Cloudflare tunnel + SSH mode

docker run -d \
  --name cloud-ubuntu \
  -e CDF_HOST="cloud.your-domain.tld" \
  -e CDF_TOKEN="<YOUR_CLOUDFLARED_TOKEN>" \
  ubuntu-fox:latest

SSH connection

Direct connection (if your Cloudflare setup is public-hostname compatible)

ssh [email protected]

Connection via cloudflared (without a config file)

ssh -o "ProxyCommand=cloudflared access ssh --hostname %h" [email protected]

Publish to Docker Hub

1) Login

docker login

2) Tag the image

docker tag ubuntu-fox:latest fox3000foxy/ubuntu-fox:latest

3) Push

docker push fox3000foxy/ubuntu-fox:latest

4) (Optional) Add a version tag

docker tag ubuntu-fox:latest fox3000foxy/ubuntu-fox:v1
docker push fox3000foxy/ubuntu-fox:v1

Security

  • Never commit a cloudflared token to the repository.
  • Use placeholders (<YOUR_CLOUDFLARED_TOKEN>) in examples.
  • Rotate tokens immediately if one was exposed.