Skip to content
Create a gist now

Instantly share code, notes, and snippets.

bash script for installing tmux without root access
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
# create our directories
mkdir -p $HOME/local $HOME/tmux_tmp
cd $HOME/tmux_tmp
# download source files for tmux, libevent, and ncurses
wget -O tmux-${TMUX_VERSION}.tar.gz${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz/download
# extract files, configure, and compile
# libevent #
tar xvzf libevent-2.0.19-stable.tar.gz
cd libevent-2.0.19-stable
./configure --prefix=$HOME/local --disable-shared
make install
cd ..
# ncurses #
tar xvzf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=$HOME/local
make install
cd ..
# tmux #
tar xvzf tmux-${TMUX_VERSION}.tar.gz
cd tmux-${TMUX_VERSION}
./configure CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include"
CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib" make
cp tmux $HOME/local/bin
cd ..
# cleanup
rm -rf $HOME/tmux_tmp
echo "$HOME/local/bin/tmux is now available. You can optionally add $HOME/local/bin to your PATH."
adibis commented Nov 29, 2012

Oh - thank you, thank you, thank you. They only had screen at work. Now I can use tmux and be happy :)

prinny commented Jan 11, 2013

Thank you! This worked perfectly for me.


Thanks so much, installed perfectly right out of the box. I hate having to figure out what libraries I need and where to get them for local installs, this saved me probably hours of pain (or from just continuing to use screen on machines I don't have root access for)...

haridsv commented Feb 26, 2013

I modified it to link statically and the resultant binary worked on a different system with different libc:

shime commented Jun 4, 2013


Forked this and made it more customizable, updated versions of installed components and provided auto-install command.

Check it out at

gundamew commented Aug 8, 2013

Thank you for this script. Clearly and really helped.


Worked on just FYI


Oh man, thanks for this. So much time savings.

hv15 commented Dec 2, 2013

Thanks :)

SteveLTN commented Dec 5, 2013

Thank you so much! I got an ssh account to a cluster from my university, but it doesn't have Tmux installed. Now with your script, my life is much easier!


You are a king among men. ;) Kudos to you-


Many, many, many thanks for this.


Brilliant! thank you

WillXu commented Mar 5, 2014

so brilliant! 

zephraph commented Mar 5, 2014

Fantastic, thanks!

jingz commented May 7, 2014

awesome thanks!

Unknown commented Jun 1, 2014

Thanks! Cannot stand screen. Now to waste some hours trying to understand why what I tried failed...




At the risk of repeated others, thanks so much for this! I've used it as a base to install Vim and tig as well. For the life of me couldn't figure out how to do it before now!

luyifan commented Jul 15, 2014


dsfcode commented Aug 10, 2014

This is awesome, thanks so much! We only have screen at work so getting tmux was a must.


I met a problem when exec

--2014-10-23 11:08:44--
Connecting to||:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2014-10-23 11:08:46--
Resolving,,, ...
Connecting to||:443... connected.
OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Unable to establish SSL connection.

my os is centos6.5 64bit

bouthilx commented Nov 2, 2014

I had the same problem. I manually downloaded libevent-2.0.19-stable.tar.gz and then everything worked fine.

chu-NMSU commented Nov 3, 2014


mnsmar commented Dec 16, 2014

Got the following error:
tmux: error while loading shared libraries: cannot open shared object file: No such file or directory

Had to:
export LD_LIBRARY_PATH=/path/to/my/home/local/lib/:${LD_LIBRARY_PATH}

aarobc commented Jan 10, 2015

@jiacai2050 change the
curl -L -O


with curl -L -O I'm getting error SSL routines: SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
with curl -O I can download something but is not a tar ball

Silox commented Feb 24, 2015



Very useful shell script, thank you!

Unknown commented Mar 15, 2015

Excellent, thank you!


Works great!


Shouldn't it be -L$HOME/local/lib/ncurses instead of -L$HOME/local/include/ncurses ?


This worked perfectly on shared server.

bmyerz commented Jul 23, 2015


bmyerz commented Jul 23, 2015

thanks, worked on redhat 4.4 fine


Other alternative could be to fetch the static binary with static-get, no compiler required =)

sh <(wget -qO- -x tmux-2.0

To list all available versions:

sh <(wget -qO- -s -v tmux


Other alternative could be to fetch the static binary with static-get, no compiler required =)

sh <(wget -qO- -x tmux-2.0

To list all available versions:

sh <(wget -qO- -s -v tmux


Other alternative could be to fetch the static binary with static-get, no compiler required =)

sh <(wget -qO- -x tmux-2.0

To list all available versions:

sh <(wget -qO- -s -v tmux


Other alternative could be to fetch the static binary with static-get, no compiler required =)

sh <(wget -qO- -x tmux-2.0

To list all available versions:

sh <(wget -qO- -v -s tmux

kedare commented Aug 28, 2015

The WGET SSL error is due to an old version of wget not supporting SNI, just replace the line that download libevent source by this one :

curl > libevent-2.0.19-stable.tar.gz
KDGNOR commented Aug 29, 2015

mathieupoussin thx u fix ssl error i got :+1:


This is great!

jealie commented Jan 21, 2016

Awesome script!

I forked it to use automatically the latest version of tmux (currently version 2.1) from the github repo:

This version relies on git to fetch the source, which also solves the SSL error some people had.


Amazing script!

nemami commented Mar 9, 2016



Thanks, great work!


I'm getting 404 errors when trying to wget the tmux tarball. Does this need to be updated? SourceForge doesn't seem to have tmux version 2.2.

vzhong commented Apr 25, 2016

For version 2.2:

  1. Change TMUX_VERSION=2.2

  2. Change URL to

gut commented Apr 27, 2016

nice! Thanks. Also for version 2.2!

xapple commented May 4, 2016 edited

I just tried this script with version 2.2 on a fresh linux install (apricityos) and got this error:

In file included from ../ncurses/curses.priv.h:283:0,
                 from ../ncurses/lib_gen.c:19:
_11601.c:835:15: error: expected ‘)’ before ‘int’
../include/curses.h:1594:56: note: in definition of macro ‘mouse_trafo’
 #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
Makefile:785: recipe for target '../objects/lib_gen.o' failed
make[1]: *** [../objects/lib_gen.o] Error 1
make[1]: Leaving directory '/home/xapple/tmux_tmp/ncurses-5.9/ncurses'
Makefile:109: recipe for target 'all' failed
make: *** [all] Error 2
xapple commented May 4, 2016 edited

I managed to compile tmux version 2.2 finally (on ubuntu 14.04). But when I copy the executable binary to another computer I get the following:

xapple@uni_cluster test $ ./tmux -V
./tmux: /lib64/ version `GLIBC_2.14' not found (required by ./tmux)
./tmux: /lib64/ version `GLIBC_2.15' not found (required by ./tmux)
./tmux: /lib64/ version `GLIBC_2.17' not found (required by ./tmux)

Is there any way to change the compilation to include these libraries ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.