
Change Where Ubuntu Stores New Data (Downloads, Documents, Pictures, etc.)
Derrk SamuelMay 23, 20264 min
The clean, reliable way to change where Ubuntu stores your default user folders using XDG user directories system — no app hacks, just system-level configuration.
Overview
Ubuntu uses the XDG user directories system to decide where apps save data by default. You can change these locations with one command.
✅ Method 1 — Change Default Folders (Recommended)
xdg-user-dirs-update --set NAME /absolute/path
Valid folder names: DESKTOP, DOWNLOAD, DOCUMENTS, MUSIC, PICTURES, PUBLICSHARE, TEMPLATES, VIDEOS
Examples
xdg-user-dirs-update --set DOWNLOAD /mnt/Data/Downloads
xdg-user-dirs-update --set PICTURES /home/$USER/Images
xdg-user-dirs-update --set DOCUMENTS /media/$USER/SSD/Documents
Log out and back in to apply changes.
📝 Method 2 — Edit the Config File Directly
nano ~/.config/user-dirs.dirs
Change the paths:
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_PICTURES_DIR="$HOME/Pictures"
🌍 System-Wide (All Users)
sudo nano /etc/xdg/user-dirs.defaults
Per-user settings override system-wide settings.
🧠 Important Notes
- Paths must be absolute (/home/... or /mnt/...)
- If your path contains spaces, always quote it:
"/media/derek samuel/FOLDER"
Moving Data to External Drives
mkdir -p "/media/user/EXTERNAL-DRIVE/Downloads"
mkdir -p "/media/user/EXTERNAL-DRIVE/Documents"
xdg-user-dirs-update --set DOWNLOAD "/media/user/EXTERNAL-DRIVE/Downloads"
xdg-user-dirs-update --set DOCUMENTS "/media/user/EXTERNAL-DRIVE/Documents"
Moving Just Kaspad (or Other Apps)
mkdir -p "/media/derek-samuel/KASPA-NODE/kaspad"
mv ~/.kaspad/* "/media/derek-samuel/KASPA-NODE/kaspad/"
kaspad --appdir="/media/derek-samuel/KASPA-NODE/kaspad"
Or with Docker:
docker run -d \
--name kaspad \
-p 16110:16110 \
-v "/media/derek-samuel/KASPA-NODE/kaspad:/app/data" \
rusty-kaspa/kaspad:latest \
--appdir=/app/data
External drives must be mounted before the app starts.
D
Derrk Samuel
Web3, crypto, and Linux PC insights — practical guides, security tips, mining setups, blockchain tools, and decentralized tech strategies for techs.
Related Articles
Discussion
Leave a comment
No comments yet. Be the first to start the discussion!


