Why You Should Back Up Your ClashX Configuration

For seasoned Mac users, ClashX is more than just a proxy client โ€” it holds a carefully tuned rule system, traffic-splitting policies, and various automated network acceleration setups. Many users manually edit complex YAML configuration files to speed up access to tools like GitHub, Slack, and Figma. Losing these personalized settings would be extremely costly to recreate from scratch.

Data Loss Warning: macOS system updates, disk failures, or accidental operations can all wipe out configuration files stored in hidden directories. Simply keeping your subscription link is not enough, because subscription links only contain node information โ€” they do not include your locally customized rules.

When you're planning to switch to a new MacBook, a perfect migration isn't just about moving documents โ€” it's about achieving zero-cost continuity for your software configurations. By backing up your ClashX config, you can restore your entire network setup on a new device in minutes, avoiding workflow interruptions caused by network misconfiguration at critical moments.

Backups also serve as a safety net. Before experimenting with new rules or changing core engine settings, keeping a copy of a known-stable configuration lets you roll back quickly if something goes wrong and your connection breaks.

Where ClashX Stores Its Configuration Files

Unlike most Mac apps that store data under ~/Library/Application Support/, ClashX follows the Linux convention for configuration management. Its core data files reside in a hidden folder within your home directory.

Core path: ~/.config/clash/

You can access it in two ways:

  • Method 1: In Finder, press Command + Shift + G, type ~/.config/clash/ in the dialog box, and press Enter.
  • Method 2: Open Terminal and navigate directly with:
cd ~/.config/clash/ && ls -la

Inside this directory, you'll typically find the following key files and folders:

  1. config.yaml: The main configuration file. When you select "Edit Configuration" from the ClashX menu bar, this is the file being edited. It contains all base settings, policy groups, and rule definitions.
  2. Country.mmdb: The GeoIP database. Clash uses it to identify the geographic location of IP addresses, enabling automatic routing such as "direct connection for domestic IPs, proxy for international IPs."
  3. profiles folder: If you use ClashX's subscription feature, downloaded subscription config files are typically stored in this subdirectory. These files are usually named with UUIDs or subscription names.
  4. logs folder: Contains runtime logs. While not essential for restoring your setup, they are very useful when troubleshooting connection issues.
  5. cache.db: A cache file that records latency test history and connection status for each node.

Manual Backup Methods

Manual backup is the most reliable approach. It's recommended every time you make significant changes to your config, or right before a major system update. Manual backups ensure you have full control over exactly what's being saved.

Method A: Quick Backup via Terminal

This is the most efficient method, ideal for users comfortable with the command line. You can archive the entire directory with a timestamp:

tar -czvf ~/Desktop/clash_backup_$(date +%Y%m%d).tar.gz -C ~/.config clash

After running this command, a compressed file named clash_backup_2026xxxx.tar.gz will appear on your Desktop. You can then upload it to iCloud Drive, Google Drive, or store it on an external USB drive.

Method B: Manual Backup via Finder

If you prefer a graphical interface, follow these steps:

  1. Navigate to the ~/.config/ directory.
  2. Locate the folder named clash.
  3. Right-click the folder and select "Compress 'clash'".
  4. Rename the resulting clash.zip and move it to a safe backup location.
Backup checklist:
  • Confirm that config.yaml has been saved (it's best to quit ClashX before backing up).
  • Check whether the profiles folder contains the subscription files you need.
  • If you have custom JS scripts or rule-set files, make sure they are included in the backup.

Automated Backup Solutions

Manual backups that rely on memory tend to be missing exactly when you need them most. Automating backups is the long-term strategy for protecting your data. On macOS, there are several mature solutions to choose from.

Time Machine: The Built-In Choice

This is the simplest option. As long as Time Machine is enabled and an external drive is connected, macOS automatically backs up all data under your home directory โ€” including the hidden .config folder. When you need to recover a specific config version from weeks ago, just enter Time Machine's timeline view, navigate to the directory, and restore individual files.

Acronis True Image: Advanced Full-Image Solution

For power users who need to synchronize environments across multiple Macs, or who have stringent data security requirements, Acronis True Image offers a more robust toolkit. It can not only back up files but also create full system images. When switching to a new Mac, you can use Acronis's cloud restore feature to bring back all app configurations โ€” including ClashX โ€” in one shot, with no reinstallation or reconfiguration needed.

๐Ÿ’พ Acronis True Image Backup Solution

Full-disk image backup + cloud sync โ€” restore all your configs and data in one click when switching Macs

Learn About Acronis True Image โ†’

Disclosure: This button contains an affiliate link. We may earn a commission from qualifying purchases. See our Advertising Disclosure.

Comparing the two approaches: Time Machine wins on being free and deeply integrated, but lacks strong cloud support. Acronis excels in restore speed, encryption security, and cross-platform synchronization. Whichever you choose, the key is to make sure your backup job is actually running.

Configuration Restore Steps

Once your new machine is ready, follow this standard procedure to restore your ClashX environment. The order matters โ€” it's best to follow it strictly.

Step 1: Install the Base Environment

Download and install ClashX or ClashX Pro on your new Mac. After installation, launch the app once. The system will prompt you to install a helper tool โ€” click Allow and enter your login password. This initial launch automatically creates the ~/.config/clash/ directory structure. Once done, quit the app completely (make sure the menu bar icon has disappeared).

Step 2: Overwrite the Config Files

Prepare your backed-up clash folder (or the extracted files). Open Terminal and run the overwrite command, or drag and drop manually in Finder:

cp -rf ~/Downloads/my_backup/clash/* ~/.config/clash/

If you're using Finder, the system will ask whether to merge or replace. Since the folder created by the fresh install is essentially empty, select "Replace All."

Step 3: Verify and Launch

Restart ClashX. Click the menu bar icon and check the "Config" menu. You should see your familiar configuration file names. Click "Update Subscriptions" to sync all node information to the latest version.

Step 4: Fix Permissions (Optional)

If you encounter errors or find that the app can't save settings after restoring, it may be due to file permissions changing during the migration. Run the following command in Terminal to reset permissions:

sudo chown -R $(whoami) ~/.config/clash

Frequently Asked Questions

Q1: After migrating to a new Mac, will my subscription links update automatically?

As long as you've restored the profiles folder and the main config file, ClashX will retain your subscription URLs. After restoring, simply click "Update Subscriptions" once, and the app will automatically fetch the latest node information from the server. If the subscription link itself hasn't expired, it will continue to work as expected.

Q2: When using Time Machine, should I manually exclude any files to save space?

The clash folder is usually very small, so there's no need to specifically exclude anything. However, if you review logs frequently, the logs folder might grow to several hundred megabytes. You can add ~/.config/clash/logs/ to Time Machine's exclusion list in its settings. As for Country.mmdb, it's essential for traffic routing โ€” it's best to keep it backed up.

Q3: Why is the node list empty after restoring my config?

This typically happens because the files in the profiles folder weren't copied correctly, or the file path references in the main config don't match the new machine's setup. Check the proxies or proxy-providers section in config.yaml. Also, make sure your system clock is set to "Set Automatically" โ€” time discrepancies can cause connection validation failures.

Q4: Can I symlink the config folder to iCloud?

Technically, you can use ln -s to link ~/.config/clash to iCloud Drive. However, this is strongly discouraged. The Clash core frequently writes to cache.db and logs at runtime, which would trigger constant iCloud syncing, leading to high CPU usage or even config corruption due to sync locks.

Q5: ClashX shows "Core failed to start" after restoring โ€” what should I do?

This is usually a permissions issue. Follow "Step 4" above to fix permissions via Terminal. Additionally, check whether the config version you restored is compatible with the newly installed version of ClashX. If you're migrating from a very old version of Clash to the latest 2026 release, you may need to adjust the config to match the updated YAML syntax.