A WebSSH container designed for convenient deployment, including an OpenShift template for streamlined setup.
This project provides a simple way to run the WebSSH Python package in a containerized environment. While there are many web-based SSH terminals (such as Wetty, WebSSH2, and others, often built on xterm.js and Node.js), this solution is based on Python and Alpine Linux for a lightweight footprint.
Note: The container uses a low keepAliveTimeout, so session persistence may not be ideal for long-running workshops.
You can build the Docker image locally using the provided Dockerfile. This setup uses Python 3.7.4 on Alpine Linux, installs the required packages and WebSSH, launches a WebSSH instance, and exposes port 8888.
git clone https://github.com/Aliman00/docker-webssh
cd docker-webssh
docker build -t aliman00/docker-webssh .Then run the container:
docker run -p 8888:8888 aliman00/docker-webssh:latestNavigate to http://localhost:8888 in your browser to access WebSSH.
If you prefer not to build the image yourself, you can pull it from Docker Hub:
docker run -p 8888:8888 aliman00/docker-webssh:latestFor OpenShift users, an OpenShift template is provided for rapid deployment:
oc create -f https://raw.githubusercontent.com/Aliman00/docker-webssh/master/openshift-template.yml
oc new-app websshThis will create:
- A DeploymentConfig that pulls the container image from Docker Hub (the version can be set via a template parameter)
- A Service (configurable via parameter)
- A Route to expose the service
Security Advisory: Always secure your OpenShift route with TLS/SSL. Exposing SSH over an insecure web browser is not recommended. Ensure you understand how your cluster handles SSL termination and apply appropriate security measures.
This project is licensed under the MIT License.
Inspired by kenmoini/docker-webssh and the WebSSH Python package.