Moving Steam Folder Out of Home in Linux

1 min read

I like to switch distros from time to time and remembering all of my little system tweaks becomes…problematic over time. Hence, I am documenting this for myself. Maybe it will benefit you too, dear reader.

I have a large SSD I use as my system disk and it annoys me greatly when Steam installs itself to my home folder. Yes, it is a larger disk, but I’d like to reap the benefits of my SSD (faster loading times) when playing games.

Luckily, it is pretty easy to move. After you install Steam, issue the following in terminal:

sudo mv ~/.local/share/Steam /opt
sudo chmod a+rwx /opt/Steam -R

This moves your Steam folder out of home and into opt. Then it updates the permissions to allow everyone read/write/execute access. You may not need to do that last part, but I want to make sure I don’t have any permissions issues when trying to install games.

Once that is done, open the Steam client and it will complain that it can’t find its files. Tell it to calm down and point it to the new location. This works because the Steam installer only installs a shell wrapper in /usr/bin that sets up the environment to run the Steam client from your home folder.

👋 Hi! I’m Chad. I’m a Tech Lead turned founder, but I mostly see myself as a web developer specializing in the .NET Core, React, and Node.js ecosystems. I like to build tools to make developers’ lives easier. I am currently working on a modern job platform for .NET Core and Node.js.

Webmentions

What is this?

8 Comments

  1. Robin Gauß
    Robin Gauß

    For everyone having trouble after moving. Just add the -R argument to change permissions for all subdirectories like:

    sudo chmod a+rwx /opt/Steam -R

    1. Chad Lee
      Chad Lee

      Thanks, Robin. I updated the post.

  2. ZiglioNZ
    ZiglioNZ

    That's what I need, thank you!

  3. Quentin B.
    Quentin B.

    I don't think giving 777 permissions to each file in /opt/Steam is a good thing (chmod 777, or chmod a+rwd should be considered as a threat for your computer's security).

    Instead of changing the rights, you can simply change the owner of the Steam folder by running this command :
    sudo chown yourusername:yourusername -R /opt/Steam

    1. 奥观海
      奥观海

      +1. That is what I wanted to say.

  4. Wheatley
    Wheatley

    I see this everywhere but all my data is in ~/.steam. There's not much at all in /.local/share/Steam

  5. Martin Neumann
    Martin Neumann

    This post has been up for three years and that reckless chmod command is still included? Why?

    You don't need it if there are no other users on your computer. And if there are, your brother or your "hilarious" roommate or whoever can do all sorts of mischievious things: replace your game executable with a script that deletes all your scores or grants access to your emails, log in to Steam and get you permabanned etc.

    DO NOT DO IT!

  6. Richard Lloyd
    Richard Lloyd

    I just did a similar Steam dir mvoe from an HDD to an NVMe PCIe SSD, but I did it with rsync (twice - I like to do 2 runs of that to confirm all files are across). I then moved the HDD steam dir to a .old version, fired up the Steam client, pointed it to the SSD and then tried out several games to make sure it all worked. Only then did I delete the old HDD steam dir.

    If anything had gone wrong, I could just move the SSD Steam dir to .old, rename the HDD Steam dir back to its original name, fire up the Steam client and point it back to the old HDD Steam dir. BTW, it took 2 hours to do a copy of the 660GB HDD steam dir to SSD, which wasn't too bad.

    Oh, and yes, the chmod stuff is utter nonsense - just make sure the Steam tree is owned by you, so "chown -R username steam_dir" would have been good enough, though you may have to that as root if you don't own something under the tree. If you must chmod -R, then u+rw would be a *lot* safer.