Skip to content

Instantly share code, notes, and snippets.

@anthonyray
Last active May 6, 2024 06:15
Show Gist options
  • Save anthonyray/398fde676a7704c03d6624155ba0011e to your computer and use it in GitHub Desktop.
Save anthonyray/398fde676a7704c03d6624155ba0011e to your computer and use it in GitHub Desktop.
Set up OhMyZsh on Amazon EC2 instance running Ubuntu Server 14.04
  1. Connect to your EC2 instance
  2. Install zsh : sudo apt-get update && sudo apt-get install zsh
  3. Edit your passwd configuration file to tell which shell to use for user ubuntu : sudo vim /etc/passwd
  4. Look for ubuntu user, and replace bin/bash by bin/zsh
  5. Install OhMyZsh : sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  6. Disconnect from your instance and reconnect it.
@unfor19
Copy link

unfor19 commented Jan 15, 2020

Combining the original solution with instance user data, you can add the following script to the instance's user-data, and then you'll have zsh installed when the instance is ready.

Very handy when using EC2 Launch Template

#!/bin/bash
sudo apt-get update && sudo apt-get install -y zsh && \
sudo chsh -s /bin/zsh ubuntu && \
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

@sandiprb
Copy link

Thanks, for this.

Added an updated version here: https://gist.github.com/sandiprb/771bcbd100a3ebf53682903a627a40df

@ronakHegde98
Copy link

Thanks for this!

@peterkodermac
Copy link

this works on Oracle VPS too, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment