Installation
Prerequisites
- Node.js >= 20.0.0 (installed automatically by the installer if not present)
- npm or yarn
One-Liner Installation (Recommended)
The recommended way to install sshift - automatically handles updates and autostart configuration:
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/lethevimlet/sshift/main/sshift-install.sh | bash
Or with wget:
wget -qO- https://raw.githubusercontent.com/lethevimlet/sshift/main/sshift-install.sh | bash
Windows (PowerShell)
Set-ExecutionPolicy Bypass -Scope Process
Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/lethevimlet/sshift/main/sshift-install.ps1" -UseBasicParsing).Content
What the Installer Does
- Checks for Node.js - Installs Node.js 20+ if not present
- Installs via npm - Installs sshift globally using npm
- Creates configuration - Sets up config at
~/.local/share/sshift/.env/config.jsonwith HTTPS enabled - Configures autostart (optional) - Sets up sshift to start on boot
- Starts the service - Automatically starts sshift after installation
- Checks for updates - Compares local and remote versions
Custom Installation Options
You can customize the installation with command-line arguments:
Linux / macOS
# Install with custom port
curl -fsSL https://raw.githubusercontent.com/lethevimlet/sshift/main/sshift-install.sh | bash -s -- --port 8080
# Show help
./sshift-install.sh --help
Windows (PowerShell)
# Install with custom port
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/lethevimlet/sshift/main/sshift-install.ps1" -OutFile "sshift-install.ps1"
.\sshift-install.ps1 -port 8080
# Show help
.\sshift-install.ps1 -help
Docker
Run sshift using Docker:
docker run -d -p 8022:8022 --name sshift ghcr.io/lethevimlet/sshift:latest
Or with docker-compose:
curl -O https://raw.githubusercontent.com/lethevimlet/sshift/main/docker/docker-compose.yml
docker-compose up -d
See Docker documentation for detailed instructions.
npm Installation
Install globally via npm:
# Install globally
npm install -g @lethevimlet/sshift
# Start the server
sshift
The application will be available at https://localhost:8022
Updating
npm update -g @lethevimlet/sshift
Uninstallation
npm uninstall -g @lethevimlet/sshift
Manual Installation from Source
If you prefer to install from source:
# Clone the repository
git clone https://github.com/lethevimlet/sshift.git
cd sshift
# Install dependencies
npm install
# Start the server
npm start
The application will be available at https://localhost:8022 (default production port)
Development Mode
# Start in development mode (port 3000)
npm run dev
Port Configuration
SSHIFT uses a flexible port configuration system with the following priority (highest to lowest):
--portCLI argument (setsPORTenv var; highest priority)PORTenvironment variable (from.envfiles or shell)config.jsondevPort(whenNODE_ENV=developmentor--dev)config.jsonport(production)- Default ports: 8022 (production), 3000 (development)
# Run on custom port (CLI argument)
sshift --port 9000
# Run on custom port (environment variable)
PORT=9000 ./sshift
# Run in development mode (uses devPort from config or 3000)
sshift --dev
# Or configure in config.json
{
"port": 8022, # Production port
"devPort": 3000 # Development port
}
Bind Address Configuration
SSHIFT can bind to a specific network interface. By default, it binds to 0.0.0.0 (all interfaces).
--bindCLI argument (setsBINDenv var; highest priority)BINDenvironment variable (from.envfiles or shell)config.jsonbindsetting- Default:
0.0.0.0(all interfaces)
# Bind to localhost only (CLI argument)
sshift --bind 127.0.0.1
# Bind to localhost only (environment variable)
BIND=127.0.0.1 ./sshift
# Bind to specific interface
sshift --bind 192.168.1.100
# Or configure in config.json
{
"bind": "0.0.0.0" # Bind to all interfaces (default)
}