Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
tmux keeps a terminal session running after your SSH connection closes. On an Ubuntu VPS, check whether it is already available with tmux -V; install the tmux package with APT only if that command is missing. Then create a named session, start your server or migration inside it, detach with Ctrl-b d, and reconnect later with tmux attach -t app.
This guide follows that complete first-use path and then covers sessions, windows, panes, configuration, isolated tmux servers, version differences, and the limits of what tmux can protect.
As an Amazon Associate I earn from qualifying purchases.
What is tmux, and why does it keep an SSH job running?
tmux is a terminal multiplexer. A tmux server manages sessions; each session contains one or more windows, and each window can contain multiple panes. Your SSH terminal is a client connected to that server. When the client disconnects, the server and its pseudo-terminals can continue running, so programs inside a detached session are not tied to the life of your SSH connection.
The Ubuntu tmux manual describes the behavior precisely: “Each session is persistent and will survive accidental disconnection (such as ssh(1) connection timeout) or intentional detaching.” This is useful for package upgrades, database migrations, log watching, editors, builds, and other commands that should continue while you close a laptop or move between networks.
Popular on Amazon
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
A useful way to picture the hierarchy is server → session → window → pane → program. The server is the background coordinator. A session is the named workspace you reattach to. Windows are full-screen terminal tabs, and panes divide a window into smaller terminals. Detaching removes only your client from this hierarchy; it does not close the session or the programs in its panes.
Free tools Windows power users keep installed
One-click scans. No signup required.
tmux is not a replacement for application-level durability. It does not add checkpoints, backups, retry logic, or monitoring to a program, and it is not a service manager for a production daemon. Use a service manager and application recovery features when a process must start automatically after a reboot or recover from its own failure.
How do I check whether tmux is installed on Ubuntu?
Log in to the VPS over SSH and ask the shell for the installed tmux version:
tmux -V
If tmux is present, the command prints a version such as tmux 3.4 or another release supplied by your Ubuntu repository. Ubuntu Server documentation says tmux is pre-installed on Ubuntu Server, but cloud images and provider templates vary, so checking first avoids an unnecessary package operation.
If the shell reports that tmux cannot be found, install it as the same administrator account you use for other APT packages. On a normal Ubuntu VPS image, refresh package metadata first:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutesudo apt update
sudo apt install tmux
Debian and Ubuntu are supported by the upstream project’s APT installation instructions. After installation, verify the command again:
tmux -V
Package versions depend on the Ubuntu release and repository state. The Ubuntu Noble manual lists tmux 3.4-1ubuntu0.2, while the Resolute manual lists 3.6a-2ubuntu0.2; those are release-specific package builds, not a promise that every VPS has the same version. Use tmux -V and man tmux when behavior or key bindings differ from an example.
A complete first-use workflow
- Connect to the VPS with SSH and run
tmux -V. - If the command is missing, run
sudo apt updatefollowed bysudo apt install tmux, then verify the version. - Create a descriptive session, for example
tmux new -s app. - Start the long-running command inside the tmux window. The command must be launched from the pane, not from the outer SSH shell.
- Press
Ctrl-b, release both keys, and pressdto detach. - Return to the ordinary SSH prompt and close the connection if you want. The detached session remains on the VPS.
- On a later login, run
tmux lsto inspect sessions andtmux attach -t appto resume the named one. - When the workload is genuinely finished, use
tmux kill-session -t appto remove the session.
This sequence is enough for a migration, deployment, build, interactive editor, or log monitor. Naming the session at creation time prevents the common mistake of reconnecting to an unnamed workspace and wondering which process is running there.
How do I create a named tmux session for a VPS workload?
Use a descriptive name rather than an unnamed session. A name makes it clear which workload you are about to re-open:
Recommended Free Tools
tmux new -s app
The command creates a session called app and switches your terminal into it. Replace app with a name such as deploy, logs, or db-migration. Keep one session per logical workload so that attaching to a session does not unexpectedly return you to an unrelated command.
Also popular on Amazon
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Once the session opens, run the long-lived command normally. For example, start your deployment, migration, log monitor, editor, or server process at the shell prompt inside the tmux window. tmux does not change how that program is launched; it only keeps the terminal environment available after your SSH client goes away.
Use the same Unix account when you later list or attach to the session. Sessions belong to the user who created them; logging in as another account can make a perfectly healthy session appear to be missing.
How do I detach from tmux without stopping the command?
Use tmux’s two-step prefix chord: press and hold Ctrl, press b, release both keys, then press d. The complete sequence is written as Ctrl-b d.
The first chord is the default tmux prefix. The second key tells tmux which operation to perform. Because you release the prefix before pressing d, the letter is interpreted by tmux rather than sent to the program running in the pane. After detaching, tmux returns you to the ordinary SSH shell, while the command in the session keeps running.
You can now close the SSH connection deliberately, or allow it to time out. The tmux server remains active on the VPS as long as the server itself and the owning user’s session remain available.
How do I reconnect to a tmux session?
After logging in again, attach to the named session from the regular SSH shell:
tmux attach -t app
The current terminal becomes a tmux client and shows the windows and panes exactly as they were left. If you do not remember the session name, list sessions first:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
tmux ls
tmux ls and tmux list-sessions show the sessions available to your user. Choose the target deliberately when several workloads are active; attaching to the wrong session can lead to entering commands in an unrelated window.
Starting tmux with no command creates a new, unnamed session:
tmux
That shortcut is convenient for a quick task, but named sessions are safer on a busy VPS because they remain easy to identify later.
Also popular on Amazon
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Which tmux commands and keys are most useful first?
The default prefix is always the first part of a key binding unless the table says “shell command.” Press Ctrl-b, release it, and then press the operation key.
| Goal | Command or key | What it does |
|---|---|---|
| Start an unnamed session | tmux |
Creates a new session and opens it. |
| Create a named session | tmux new -s app |
Creates a session with an explicit name. |
| List sessions | tmux ls or tmux list-sessions |
Shows sessions available to your user. |
| Attach | tmux attach -t app |
Reopens the named session in the current terminal. |
| Detach | Ctrl-b d |
Leaves programs running and returns to the SSH shell. |
| New window | Ctrl-b c |
Adds another full-screen terminal window in the session. |
| Next window | Ctrl-b n |
Moves to the next window. |
| Previous window | Ctrl-b p |
Moves to the previous window. |
| Vertical split | Ctrl-b % |
Splits the current window into left and right panes. |
| Horizontal split | Ctrl-b " |
Splits the current window into top and bottom panes. |
| Show key bindings | Ctrl-b ? |
Opens the key-binding list for the running tmux configuration. |
| Kill a session | tmux kill-session -t app |
Closes that session and all of its windows. |
A window is a full-screen workspace inside a session. Panes divide one window, allowing you to watch logs beside a shell or keep a monitor visible while operating another command. Splitting does not create a new session, so all panes in that window share the same session lifecycle.
How do I split panes and move between windows?
From inside a session, press Ctrl-b % for a left-and-right split or Ctrl-b " for a top-and-bottom split. Each pane opens a shell in the current working context and can run its own command. This is useful for pairing a deployment command with a log tail or an interactive database client.
When one window becomes crowded, press Ctrl-b c to create a fresh window. Move forward with Ctrl-b n and backward with Ctrl-b p. The current window and pane remain running while you move elsewhere, so a process does not stop merely because it is not visible.
If you forget a binding, press Ctrl-b ?. tmux opens its current key-binding list, which reflects any configuration changes rather than assuming the default map.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →How should I organize tmux sessions on a VPS?
Choose names that describe the purpose, not the date or terminal from which you connected. For example:
deployfor a release or build operation.logsfor a persistent log-monitoring workspace.db-migrationfor a schema or data migration.
Before attaching, run tmux ls and confirm the target name. The commands should normally be run as the same Unix user that owns the session. A session created by one account is not automatically visible to another account merely because both accounts can SSH to the same VPS.
When a workload is finished, close its session intentionally:
tmux kill-session -t app
This terminates the session’s windows and the processes still attached to those panes. Do not use the command as routine cleanup until you have confirmed that the workload is complete.
Can I isolate tmux sessions with a separate server socket?
Yes. tmux can run separate servers, which is useful for automation or deliberately isolated environments. The default server socket is under /tmp. Use -L name to select a named socket or -S path to select an explicit socket path.
Also popular on Amazon
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Widely Compatible: Transform any USB-C port into a USB-A port and USB-A port into a USB-C port, and connect up a wide range of USB-C(including MacBook, iPad Pro/Air/Mini, iPhone models with USB C ports, Samsung Galaxy series, and Google Pixel series. ) and USB A devices(including external hard drives, phones, mice, printers, and more)
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Every command in that isolated workflow must use the same socket selection. For example, if a session was created with a named socket, the later list and attach commands must specify that same -L value; otherwise tmux will look at the default server and report a different set of sessions. This is a common explanation for an apparently empty result from tmux ls: the session may exist, but under another socket or Unix account.
Where does tmux read its configuration?
tmux reads a system configuration at /etc/tmux.conf when that file exists, then checks user configuration locations. The Ubuntu manual identifies ~/.tmux.conf, $XDG_CONFIG_HOME/tmux/tmux.conf, and the user-level tmux configuration path as places to check. A provider image or administrator may therefore give your VPS a configuration different from the upstream defaults.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteConfiguration commands are read when the tmux server starts. If you edit a user file while a server is already running, load the changes explicitly:
tmux source-file ~/.tmux.conf
You do not need a configuration file for normal use. Start with the default Ctrl-b prefix and built-in bindings. Only add changes you understand, such as enabling mouse support, changing the prefix, or making the status line easier to read. A changed prefix also changes how every later key binding is invoked, so document it for anyone else who administers the VPS.
If a configuration change seems to have had no effect, verify which server you are talking to and reload the file from that server. A file edit alone does not retroactively change an already-running server, and a second socket selected with -L has its own configuration state.
What should I do if tmux does not behave as expected?
The install command cannot find a package
Run sudo apt update and retry sudo apt install tmux. If the package is still unavailable, check the VPS’s Ubuntu release and configured repositories rather than copying a package version from another release.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Attach says the session does not exist
Run tmux ls first. You may have typed a different name, logged in as another Unix user, or selected a different server socket with -L or -S.
The key sequence types a character instead of detaching
Use the two-step sequence exactly: press Ctrl-b, release both keys, then press d. If an administrator changed the prefix in a configuration file, press the configured prefix instead and use Ctrl-b ? to inspect the active bindings.
The command stopped anyway
Confirm that it was started inside the tmux pane and that you detached rather than terminating the shell or killing the session. tmux protects a running terminal from client disconnection; it cannot prevent the program itself from exiting, failing, or being stopped by an administrative action.
The VPS rebooted
A reboot ends the tmux server and ordinary user processes. Reattach only after starting a new session, and use a service manager or application startup and recovery configuration for work that must return automatically after boot.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchAlso popular on Amazon
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Which Ubuntu tmux version should I use?
Use the version supplied by your Ubuntu release and repositories unless you have a specific compatibility requirement. The Noble and Resolute manuals show different package builds, so copying a version number from another VPS can produce misleading expectations. For release-specific options, consult the output of tmux -V and the local manual with man tmux.
Is there a tmux book for deeper workflows?
For a structured follow-up, Brian P. Hogan’s tmux 3: Productive Mouse-Free Development is a 118-page book published in March 2025. Its coverage includes installation, starting tmux, detaching and attaching sessions, windows, panes, configuration, scripting, and practical workflows for VPS or cloud environments. Retail availability, edition, price, and affiliate terms can change, so check the current publisher or retailer listing before buying.
Frequently Asked Questions
Can I attach to the same tmux session from two SSH terminals?
Yes, multiple tmux clients can connect to one session, so two terminals can observe the same windows and panes. Be careful when both clients can type into the same pane because each keystroke affects the shared shell or application.
Does tmux keep a process alive after the VPS reboots?
No. A reboot stops the tmux server along with ordinary user processes. Use a service manager and application startup or recovery configuration when work must return automatically after boot.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
How can I tell which tmux server a session belongs to?
A normal session appears under the default server socket, while workflows using -L or -S belong to the explicitly selected socket. Repeat the same socket option with tmux ls or tmux attach to inspect that server.
Is a detached tmux session a substitute for backups or migration checkpoints?
No. Detaching only preserves the terminal and its running process across an SSH client disconnect. The application still needs its own error handling, checkpoints, backups, and monitoring for dependable recovery.
Is tmux already installed on every Ubuntu VPS?
Ubuntu Server documentation describes tmux as pre-installed, but cloud images and provider templates differ. Run tmux -V first and install the tmux package with APT only when the command is unavailable.
Why can another SSH user not see my session?
Sessions are associated with the Unix user that created them. Log in as that user, or deliberately use the appropriate permissions and socket arrangement; simply sharing the same VPS does not merge users’ session lists.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →What happens if I kill a tmux session?
tmux kill-session -t name closes the session, its windows, and processes still attached to those panes. Confirm the workload is complete before running it.
Do I need a custom tmux configuration?
No. The default Ctrl-b prefix and built-in bindings are sufficient for installation, detaching, attaching, windows, and panes. Add a configuration only when you understand the change and know how to reload it.
The Bottom Line
Bottom line: Check with tmux -V, install the Ubuntu package only if needed, create a named session, run the workload inside it, detach with Ctrl-b d, and reconnect with tmux attach -t name. tmux protects work from an SSH disconnect, not from program failure, reboot, missing backups, or the absence of a service manager.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →

