How to Set Up Auto-Update for Clash Subscriptions: Always Have Fresh Nodes

2026-08-23 Reading time: ~ 7 min

Understanding the Mechanics of Auto-Updates

Proxy nodes are not static. Providers frequently rotate IP addresses, migrate servers, or adjust bandwidth limits to bypass censorship and manage costs. If you rely on a static configuration file, your connection will eventually drop, leaving you scrambling to manually download and import a new subscription.

The clash auto update subscription mechanism solves this by periodically fetching the latest configuration from your provider's remote server. Instead of hardcoding nodes into your local config.yaml, the client maintains a reference to the remote URL. At specified intervals, it downloads the raw payload, parses the nodes, and seamlessly merges them with your local routing rules and preferences.

Core Concept

Auto-update does not just replace your entire configuration. Modern clients separate the subscription payload (nodes and basic proxy groups) from your local overrides (rules, DNS, and custom scripts). This ensures that your personalized routing logic remains intact when nodes are refreshed.

When Mihomo fetches an update, it reads the store-selected: true parameter in your configuration. This crucial setting tells the core to remember your active proxy selection across restarts and updates. Without it, every auto-update would reset your active node to the default, disrupting your workflow.

Prerequisites for Seamless Updates

Before configuring automated refreshes, you must ensure your foundation is solid. A broken initial setup will only compound errors when automation is introduced.

Step 1: Verify Your Subscription URL

Ensure your provider supplies a direct subscription link, not just a static YAML file. The URL should dynamically generate the latest node list upon each request. Test the URL in a browser or via curl to confirm it returns valid Base64 or YAML data.

Step 2: Check Client Compatibility

Ensure your client supports the clash auto update subscription feature. Legacy Clash Premium clients have been deprecated. You should be using Mihomo (Clash Meta) core with a compatible GUI like Clash Verge Rev, Clash Nyanpasu, or Clash Meta for Android.

Initial Import Issues

If your subscription fails to load even once before you can set up auto-updates, the automation will never trigger. If you encounter parsing errors or network blocks during the first import, refer to our detailed troubleshooting guide on Clash Subscription Import Failed Fix to resolve the baseline connectivity issues.

Configuring Auto-Update in Clash Verge Rev

Clash Verge Rev is currently the most popular desktop client for Mihomo. It features a robust profile management system that handles auto-updates elegantly.

Step 1: Add the Remote Profile

Navigate to the Profiles tab. Click the New Profile button and select Remote. Paste your subscription URL into the Url field. Give it a recognizable name in the Name field.

Step 2: Set the Update Interval

Once the profile is added, click the gear icon (Settings) next to the profile card. Locate the Update Interval setting. This value is measured in seconds. For most users, an interval of 86400 (24 hours) or 43200 (12 hours) is optimal. Enter your desired value and save.

Leveraging Local Overrides

To prevent the remote subscription from overwriting your custom DNS or routing rules, use the Chain feature or write a local Override script. For advanced customization techniques, check out our Clash Verge Rev Tips guide, which covers Lua and JavaScript overrides in depth.

Setting Up Auto-Update on Clash Meta for Android

Mobile users face frequent network environment changes. Keeping nodes fresh on Android is critical for battery life and connection stability.

Step 1: Import the Subscription

Open the app and go to the Profile section. Tap the + icon and select URL. Paste your subscription link and confirm.

Step 2: Configure Background Updates

Long-press the imported profile card and select Edit. Find the Auto Update toggle and enable it. Set the Update Interval to your preference. Note that Android's aggressive battery optimization might delay background tasks. To ensure the clash auto update subscription runs on time, add the app to your device's battery optimization whitelist.

Advanced: Headless Linux Automation via Cron

For users running Mihomo on a headless Linux server, router, or NAS without a GUI, the core application does not natively poll remote subscriptions. You must build an external automation pipeline.

This approach involves using a shell script to download the subscription, convert it if necessary, and trigger a Mihomo API reload.

#!/bin/bash
# /opt/clash/update-sub.sh

SUB_URL="https://provider.com/api/v1/sub?token=xyz"
CONFIG_DIR="/etc/mihomo"
TEMP_FILE="/tmp/sub-raw.yaml"

# Download the raw subscription
curl -sL "$SUB_URL" -o "$TEMP_FILE"

# If your provider outputs Base64, decode it first
# base64 -d "$TEMP_FILE" > "$CONFIG_DIR/config.yaml"

# If it is already YAML, move it directly
mv "$TEMP_FILE" "$CONFIG_DIR/config.yaml"

# Reload Mihomo via RESTful API
curl -s -X PUT http://127.0.0.1:9090/configs \
  -H "Content-Type: application/json" \
  -d '{"path": "/etc/mihomo/config.yaml"}'

Merging Local Configurations

Downloading the raw subscription overwrites your local DNS and routing tweaks. To solve this, use yq to merge the downloaded subscription with a local base configuration.

# Install yq
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
chmod +x /usr/bin/yq

# Merge base config with remote subscription
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' \
  /etc/mihomo/base.yaml /tmp/sub-raw.yaml > /etc/mihomo/config.yaml
Step 3: Schedule with Cron

Open your crontab by running crontab -e. Add the following line to execute the script every 6 hours:

0 */6 * * * /bin/bash /opt/clash/update-sub.sh >> /var/log/clash-update.log 2>&1
Handling Incompatible Formats

If your provider only outputs Surge or V2Ray formats, you cannot feed them directly to Mihomo. You must pipe the raw output through a conversion service like subconverter before saving it to config.yaml. Refer to our Clash Subscription Conversion Guide for detailed instructions on setting up local or remote conversion endpoints.

Troubleshooting Auto-Update Failures

Even with automation configured, updates can fail silently or throw errors. Understanding the common failure points is essential for maintaining a reliable proxy environment.

HTTP 403 Forbidden or Network Timeouts

If the client cannot reach the subscription server, it will keep using the cached nodes. This often happens if the subscription domain is blocked by your local ISP or if the provider requires a specific User-Agent.

Custom User-Agent

In Clash Verge Rev, you can add a User-Agent header in the profile settings. Setting it to ClashforWindows/0.20.39 or ClashMetaForAndroid/2.8.0 often bypasses provider-side bot protection.

YAML Parsing Errors After Update

If the provider changes their configuration structure (e.g., migrating from legacy Clash to Mihomo syntax), the auto-update might download a file that breaks your client. Always ensure your core version matches the subscription format requirements. Check the Mihomo release notes for any breaking changes in YAML schema.

Best Practices for Subscription Management

Setting up the clash auto update subscription is only the first step. Managing how those updates interact with your local environment ensures long-term stability.

Many advanced users maintain multiple subscriptions to balance cost and performance. For example, you might use a premium subscription for streaming and a budget one for general browsing. In Clash Verge Rev, you can chain multiple remote profiles. The client will merge the node lists, allowing you to create complex proxy-groups that route traffic based on the combined node pool.

Avoid Excessive Polling

Do not set your update interval below 1 hour unless absolutely necessary. Aggressive polling can trigger rate limits on your provider's server, resulting in IP bans or temporary subscription blocks. An interval of 12 to 24 hours is sufficient for 99% of use cases.