Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using Oh My Zsh in unRAID?

Featured Replies

Hey!, 

 

So, I wanna use zsh+Oh My Zsh in the unRAID shell but I'm having some issues with the setup so that it gets re-installed on every reboot. I enabled zsh using the nerd pack plugin then I can install OMZ manually and it works perfectly but I can't figure out how to make it persist after a reboot. 

 

In summary. I enabled zsh on the nerd pack and added these lines to my go script: 
 

Quote

# Install Oh My ZSH!
chsh -s $(which zsh)
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
cp /boot/extra/scripts/oh-my-zsh/.zshrc /root/

 

The result is that I get zsh as the default shell correctly but the weird thing is that when I SSH into unRAID using PuTTy I don't have Oh My Zsh installed and yet in the command prompt in the actual server (as in, the video output from that computer) I see it installed correctly. 

 

Am I missing anything?. 

  • 1 year later...

Yes, running from the go file or from user scripts, you will have issues (just like I did). The install script uses home variables, which do not expand properly (instead of ~/ becoming /root, it becomes //).

 

I broke down the installer script, and fixed it for unraid. Here is what I use:

ZSH="/root/.oh-my-zsh"
umask g-w,o-w
git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH
cp "$ZSH"/templates/zshrc.zsh-template /root/.zshrc
sed "/^export ZSH=/ c\\
export ZSH=\"$ZSH\"
" /root/.zshrc > /root/.zshrc-omztemp
mv -f /root/.zshrc-omztemp /root/.zshrc
chsh -s $(which zsh)
env zsh -l

 

  • 2 weeks later...

I figured out a simpler way, just define $HOME for scripts:

HOME="/root"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

 

  • 1 month later...
On 1/1/2019 at 10:25 PM, d2dyno said:

I figured out a simpler way, just define $HOME for scripts:


HOME="/root"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

 

Thought I'd just mention......zsh is in the unraid NerdPack plugin......that is probably the easiest way to install zsh and have it persist through reboots. If you haven't used NerdPack plugin, I'd suggest looking into it. Makes installing various tools and have them persist extremely easy

Edit: Apologies.....you referring to Oh-My-Zsh.....

Edited by Stupifier

1 minute ago, Stupifier said:

Apologies.....you referring to Oh-My-Zsh

Yep, though nerdpack is what I used to install zsh, as you said 😀 then oh my zsh must be installed on top of that.

  • 1 year later...

Late post, but hopefully one of you all might see this. I was just wondering how you're handling making your .zshrc and any plugins persistent? Thanks!

7 minutes ago, xthursdayx said:

Late post, but hopefully one of you all might see this. I was just wondering how you're handling making your .zshrc and any plugins persistent? Thanks!

I used the User Scripts plugin to run this script on first start of array :

#!/bin/bash

# umask setup
umask 077

# Variable Setup
CONFIG=/boot/config/ssh
HOME_SSH=/root/.ssh
ZSH="/root/.oh-my-zsh"

mkdir -p $HOME_SSH
cp $CONFIG/pre-set/* $HOME_SSH
chmod 700 $HOME_SSH
chmod 644 $HOME_SSH/id_rsa.pub
chmod 600 $HOME_SSH/id_rsa
chmod 600 $HOME_SSH/authorized_keys

### Install zsh shits
HOME="/root"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
umask g-w,o-w
chsh -s $(which zsh)
env zsh -l

newplugins="git tmux zsh-autosuggestions"

sed -i  "s/(git)/($newplugins)/" /root/.zshrc
sed -i "s#\(ZSH_THEME *= *\).*#\1agnoster#" /root/.zshrc
echo "cd /mnt/user/" >> /root/.zshrc
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH/custom/plugins/zsh-autosuggestions
chmod 700 /root/.oh-my-zsh/custom/plugins/zsh-autosuggestions
###

# Copy terminal (zsh) history
cp /boot/config/.zsh_history /root

Combined with this array stop script to copy ZSH history and SSH keys:

#!/bin/bash

# Copy terminal (zsh) history
touch /boot/config/.zsh_history
echo "$(cat /root/.zsh_history)" >> /boot/config/.zsh_history

# Variable Setup
CONFIG=/boot/config/ssh
HOME_SSH=/root/.ssh
# Copy any new keys on exit
rsync -avhW $HOME_SSH/ $CONFIG/pre-set

As for .zshrc (or aliases), I use /boot/config/go to write to /etc/profile on startup (how I was taught here to do it):

# Re-make aliases on boot
echo "
#### Aliases copied from /boot/config/go ####
alias size='du -c -h -d 1 | sort -h'
export TERM=xterm-color
#### End Aliases ####">>/etc/profile

These are just example aliases and settings, use your own (though I do love that size alias)

Edited by d2dyno

Thanks @d2dyno !

 

Just to clarify, was there a reason you added these lines to /boot/config/go rather than your .zshrc?

On 12/7/2020 at 5:23 PM, d2dyno said:


# Re-make aliases on boot
echo "
#### Aliases copied from /boot/config/go ####
alias size='du -c -h -d 1 | sort -h'
export TERM=xterm-color
#### End Aliases ####">>/etc/profile

 

Edited by xthursdayx

  • 2 years later...
On 12/7/2020 at 2:23 PM, d2dyno said:

I used the User Scripts plugin to run this script on first start of array :

 

Combined with this array stop script to copy ZSH history and SSH keys:

 

As for .zshrc (or aliases), I use /boot/config/go to write to /etc/profile on startup (how I was taught here to do it):

 

These are just example aliases and settings, use your own (though I do love that size alias)

 

Super helpful - thank you very much - late to the game by three years - but was setting up a new box and this was helpful as i was relearning how to set things up

  • 5 months later...

I have been using Oh My Zsh in Linux for sometime. Recently I have installed and set up unRaid on a couple servers. Unfortunately, with countless research, I have not be able to find/locate a complete walk through guide of setting up, configuring, and using Oh My Zsh in the unRaid software. I was wondering if such documentation/video exists? I have also been wanting to change or modify the command prompt gui, but have not be able to locate information towards that as well. If someone could point me into the right direction, it would be greatly appreciated.

On 12/14/2023 at 5:19 PM, AaronIA said:

I have been using Oh My Zsh in Linux for sometime. Recently I have installed and set up unRaid on a couple servers. Unfortunately, with countless research, I have not be able to find/locate a complete walk through guide of setting up, configuring, and using Oh My Zsh in the unRaid software. I was wondering if such documentation/video exists? I have also been wanting to change or modify the command prompt gui, but have not be able to locate information towards that as well. If someone could point me into the right direction, it would be greatly appreciated.

 

Just a few days ago I was able to get successfully set this up using this:

 

https://gist.github.com/khongi/23103333ff0493e7cf109d6494515fba

 

I slightly modified it to install powerlevel10k theme, a couple other oh-my-zsh plugins, and some other dotfiles.

  • 1 year later...

does this show up when for example it shows code during container updates etc?

Screenshot 2025-10-22 at 21.28.41.png

Edited by dopeytree

  • 6 months later...

I'm kind of afraid to ask, but why isn't anyone else just using symlinks from the array and bypassing flash entirely? Sort of like this (after installing it with curl), set to run on array start:

#!/bin/bash

for TARGET in /root/.zshrc /root/.oh-my-zsh; do
    if [ -e "$TARGET" ] || [ -L "$TARGET" ]; then
        rm -rf "$TARGET"
        if [ $? -ne 0 ]; then
            logger -t zsh-setup "failed to remove $TARGET, aborting"
            exit 1
        fi
    fi
done

ln -s /mnt/user/zshconf/.zshrc /root/.zshrc
if [ $? -ne 0 ]; then
    logger -t zsh-setup "failed to symlink .zshrc"
    exit 1
fi
logger -t zsh-setup "symlinked .zshrc"

ln -s /mnt/user/zshconf/.oh-my-zsh /root/.oh-my-zsh
if [ $? -ne 0 ]; then
    logger -t zsh-setup "failed to symlink .oh-my-zsh"
    exit 1
fi
logger -t zsh-setup "symlinked .oh-my-zsh"

and then when the array is stopped:


#!/bin/bash

for TARGET in /root/.zshrc /root/.oh-my-zsh; do
    if [ -e "$TARGET" ] || [ -L "$TARGET" ]; then
        rm -rf "$TARGET"
        if [ $? -ne 0 ]; then
            logger -t zsh-stop "failed to remove $TARGET, aborting"
            exit 1
        fi
    fi
done

cp /mnt/user/zshconf/.zshrc /root/.zshrc
if [ $? -ne 0 ]; then
    logger -t zsh-stop "failed to copy .zshrc"
    exit 1
fi
logger -t zsh-stop "copied .zshrc"

cp -r /mnt/user/zshconf/.oh-my-zsh /root/.oh-my-zsh
if [ $? -ne 0 ]; then
    logger -t zsh-stop "failed to copy .oh-my-zsh"
    exit 1
fi
logger -t zsh-stop "copied .oh-my-zsh"

That way once the array is stopped after having been started, the config files persist. The only case where your config wouldn't be applied would be on first boot and in that case I wouldn't really care if I had to use zsh or bash with no config. I could be missing something and haven't fully tested this solution, but it seems a bit more clean than running the install script every boot, no?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.