Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install and Use Tmux on Ubuntu

Install Tmux, start a session and learn how to detach and reattach so your work keeps running.

VPS and Cloud Servers1 min read6 screenshots

Why use Tmux

  • Session management. Run many terminals in one window.
  • Persistence. Sessions keep running after you disconnect from SSH.
  • Custom setup. You can change keys and looks.
  • Efficiency. Split the screen to see several things at once.

Install Tmux

Update the package list:

sudo apt update

Install Tmux:

sudo apt install tmux
Installing Tmux

Check the version:

tmux -V
The Tmux version

The basics

  • A session is one Tmux instance.
  • A window is a tab inside a session.
  • A pane is a split part of a window.

Basic commands

Start a session

tmux
A new Tmux session

Detach

Press Ctrl+b, then d. The session keeps running in the background.

Detaching from Tmux

Attach again

tmux attach
Attaching to a session

List sessions

tmux ls
Listing the sessions

Useful keys (press Ctrl+b first)

  • c creates a new window.
  • n and p go to the next and previous window.
  • % splits the pane left and right.
  • " splits the pane top and bottom.
  • x closes the current pane.

Quick recap

  • Install with sudo apt install tmux.
  • Detach with Ctrl+b d and return with tmux attach.