tunn: Simplify SSH Tunnel Management with YAML Configuration
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
tunn is a Go-based tool that simplifies the management of SSH tunnels. It allows users to define and launch multiple SSH tunnels using a single YAML configuration file, leveraging existing OpenSSH setups. This utility streamlines the process of connecting to remote services, offering features like parallel execution and daemon mode for background operation.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
tunn is an open-source tool written in Go, designed to simplify the creation and management of SSH tunnels. It acts as a developer-friendly wrapper around OpenSSH, enabling users to define and control multiple tunnels through a single, intuitive YAML configuration file. This utility is ideal for developers and system administrators who frequently need to establish secure connections to remote services, such as databases or APIs, without complex manual commands.
Installation
tunn offers several straightforward installation methods to get you up and running quickly.
Quick Install
curl -sSL https://raw.githubusercontent.com/strandnerd/tunn/main/scripts/install.sh | sh
From Go Install
Ensure you have Go 1.21 or higher installed.
go install github.com/strandnerd/tunn@latest
Build Locally
git clone https://github.com/strandnerd/tunn.git
cd tunn
go build -o tunn
sudo mv tunn /usr/local/bin/
Examples
tunn makes managing SSH tunnels intuitive with its YAML configuration and simple command-line interface.
Configuration
Create a ~/.tunnrc file in your home directory to define your tunnels:
tunnels:
api:
host: myserver # SSH host from ~/.ssh/config
ports:
- 3000:3000 # local:remote port mapping
- 4000:4001
user: apiuser # optional: SSH user
identity_file: ~/.ssh/id_rsa # optional: SSH key
db:
host: database
ports:
- 3306:3306 # MySQL
- 5432:5432 # PostgreSQL
user: dbadmin # optional: overrides SSH config
cache:
host: cacheserver
ports:
- 6379:6379 # Redis
Ensure your SSH hosts are defined in ~/.ssh/config, for example:
Host myserver
HostName 192.168.1.100
User myuser
Port 22
Usage
Run All Tunnels:
tunn
Run Specific Tunnels:
# Single tunnel
tunn api
# Multiple tunnels
tunn api db
Run Tunnels in the Background (Daemon Mode):
tunn --detach
This command detaches tunn to run as a background service.
Check Daemon Status:
tunn status
This reports the PID, mode, and port states for managed tunnels.
Stop the Daemon:
tunn stop
This command cleanly shuts down the tunn daemon.
Why Use tunn?
tunn stands out for its simplicity and powerful features, making it an excellent choice for managing SSH tunnels:
- Simple Configuration: Define all your tunnels in a single, easy-to-read YAML file.
- Leverages Existing SSH Setup: Integrates seamlessly with your
~/.ssh/configand existing SSH keys. - Parallel Execution: All defined tunnels run concurrently, improving efficiency.
- Daemon Mode: Run tunnels as a background service, freeing up your terminal.
- Fine-Grained Control: Run all tunnels or selectively launch specific ones by name.
- Go Module: A lean Go module with minimal dependencies, ensuring clean and portable builds.
Links
For more detailed information, contributions, or to report issues, visit the official GitHub repository:
Related repositories
Similar repositories that may be relevant next.
Qovira: A Private, Self-Hostable AI Personal Assistant in Go
September 15, 2026
Qovira is an ambitious project aiming to deliver a private, self-hostable AI personal assistant. Built with Go and SvelteKit, it will organize reminders, notes, and schedules using AI, all on infrastructure you control. Currently in early development, Qovira promises a secure and private alternative to cloud-based AI tools.

Goon: Autonomous AI Worker for Software Development and Custom Workflows
September 15, 2026
Goon is a self-hosted, autonomous AI worker designed to streamline software development and automate custom workflows. Built with Go and having zero dependencies, it operates as a daemon, capable of tasks from writing code and opening PRs to summarizing emails and monitoring logs. It learns from your context and asks for human approval before acting, ensuring controlled and intelligent automation.
nebula-sync: Effortlessly Synchronize Your Pi-hole Configurations
May 2, 2026
nebula-sync is a powerful tool designed to synchronize configurations across multiple Pi-hole v6.x instances. Developed in Go, it offers both full and selective synchronization options, ensuring your ad-blocking setup remains consistent and up-to-date across your network. This project simplifies the management of distributed Pi-hole deployments.
Froggit: A Modern, Minimalist Git TUI for Streamlined Workflow
April 14, 2026
Froggit is a modern, minimalist Git Terminal User Interface (TUI) designed to simplify your Git workflow. It offers visual feedback, keyboard-driven controls, and seamless integration with your terminal, enhancing clarity and speed for common Git operations. Built with Go, Froggit provides a fast and efficient way to manage your repositories across Windows, Linux, and macOS.
Source repository
Open the original repository on GitHub.
24 counted GitHub visits