No Foreign Card Needed: Two Steps to Securely Subscribe to Claude Codex and Set Up a Private VPN

@FeitengLi
CHINOISil y a 1 jour · 04 juil. 2026
129K
163
33
8
441

TL;DR

This guide explains how to bypass foreign credit card restrictions for Claude and ChatGPT using mobile gift cards and provides a one-click script for deploying a personal VPN on a VPS.

This article is written for friends who want to set up a personal VPN and use Claude Codex safely.

There are only two points to keep Claude Code from being banned:

  1. A secure payment method
  2. A stable IP from a supported region (US IP recommended)

There are many myths online: "You must use a residential IP, and you'll be detected if your time zone is Beijing/Shanghai or if you use Simplified Chinese." These are purely speculative. I have been using a VPN with a data center IP and using Claude Code on four computers (Mac and Ubuntu) simultaneously for over half a year, and my account is perfectly fine.

Secure Payment Methods

1. Legitimate foreign bank credit cards

  • Use a foreign credit card to subscribe directly on the web interface.
  • Isn't it expected that virtual cards like WildCard get banned?

2. If you don't have a foreign credit card, subscribe via mobile

  • On Android, pay using Google Play balance or Google Pay (domestic Visa cards work)

1) Prepare a US Google account. If your current account region is not the US, you can switch it in the Google Play settings. Purchase Google Play gift cards; you can find Google Play USA options in Alipay's "Big Name Gift Cards" and buy them directly with RMB. Download the official ChatGPT App from Google Play → Log in to your ChatGPT account → Upgrade to Plus → Pay with Google Play balance.

2) Google Pay Payment

  • On iPhone, use a US (or other supported region) Apple ID to log into the App Store and download Claude. Do not bind a mainland Chinese bank card for payment. Use gift cards: find App Store gift cards on Xianyu, 100 USD is roughly 660 RMB.

Stable VPN

Below is an introduction to how to deploy a safe and reliable VPN on a VPS with a single command line, including a UI for free configuration.

  • Please comply with local laws and service provider rules; this is for personal learning and use only.
Feiteng - inline image

Step 1: Purchase a VPS

If you already have a VPS, you can skip to the next section. If not, I recommend Hostinger's KVM VPS because it supports Alipay, has a low barrier to entry, includes a free domain, offers a 30-day refund policy, and the backend is quite intuitive (more in line with modern habits compared to older providers).

  • For running just a lightweight VPN: KVM 1
  • Most people's first choice: KVM 2
  • If you also need to run websites, Docker, Traefik, Dokploy, or multiple services: KVM 4
  • For clear high-load requirements: KVM 8

Use the referral link for a 20% discount:

I personally recommend KVM 2. It has 2 vCPUs / 8 GB RAM / 100 GB NVMe, which is more comfortable for S-UI, system updates, lightweight services, and occasional traffic peaks.

Feiteng - inline image

On the VPS page, select KVM VPS -> Choose Ubuntu 24.04 LTS as the operating system.

You can choose a US data center, which is suitable for daily use of tools like Claude Code and Codex.

You can pay with Alipay:

Feiteng - inline image

The machine will be ready in about 2 minutes after purchase.

Feiteng - inline image
Feiteng - inline image
Feiteng - inline image

Step 2: Confirm SSH Login

Feiteng - inline image

Test SSH in your computer's terminal. Replace the IP below with your server's public IP:

Replace [email protected] in subsequent commands with your actual SSH address.

Step 3: One-Line Deployment

New VPS instances can directly use port 443.

Replace [email protected] with your SSH address, then copy and run (in your computer's terminal—not in a VPN environment):

bash
1curl -fsSL https://raw.githubusercontent.com/fvp1717/freevpn/main/install.sh | bash -s -- --target [email protected] --inbound-port 443

The script will prompt you to enter an S-UI panel username and password. You must remember this account and password, as you will need them later to log into the panel, manage VPN users, and view configurations.

Once the script is complete, it will output the panel addresses. Defaults are:

Open the panel address and enter the username and password you just set.

Feiteng - inline image

User Management:

Feiteng - inline image

There will be two example clients for Mac and iPhone in user management. They use independent UUIDs/passwords and do not share keys. You can rename them and add new users to support multiple isolated devices.

Ports

If you have enabled the VPS provider's firewall, you need to allow the ports used by the deployment script.

When using port 443 on a new VPS, allow at least:

  • 443 TCP
  • 443 UDP

If you want to open the panel and subscription directly on the public network, allow:

  • 2095 TCP
  • 2096 TCP

If you are using an existing service VPS and later change the inbound port to 8443, then allow 8443 TCP and 8443 UDP.

Feiteng - inline image

Step 5: Choose a Client

You can continue using your familiar clients; the VPN supports multiple protocols:

On macOS, if v2rayN prompts that the app is damaged, you can run:

xattr -cr /Applications/v2rayN.app

Feiteng - inline image

If you are unfamiliar with the clients, you can refer to the following video for configuration:

Existing VPS

If this VPS is already running websites, Docker, Traefik, Nginx, Caddy, Dokploy, an old VPN, a panel, or other business services, do not occupy port 443 directly.

First, do a read-only pre-check without installing or modifying files:

curl -fsSL https://raw.githubusercontent.com/fvp1717/freevpn/main/install.sh | bash -s -- --target [email protected] --preflight

Focus on:

  • Whether 443 is already occupied
  • Whether 8443 is free
  • Whether S-UI is already installed
  • Whether there are existing S-UI clients
  • Whether the automatically detected public IPv4 is correct

If 443 is already occupied by another service, change to an idle port, for example:

curl -fsSL https://raw.githubusercontent.com/fvp1717/freevpn/main/install.sh | bash -s -- --target [email protected] --inbound-port 8443

The script will check for port conflicts again before writing the configuration; if the port is occupied by another process, it will exit directly.

If the target machine already has S-UI installed, the script will not overwrite existing clients by default. Only add --replace-existing if you are sure you want to replace it with this minimal Mac/iPhone configuration.

Finally

Happy vibing!

Turn one viral article into a full content workflow

Collect the source, decode the pattern, create assets, draft the story, and distribute from one AI workspace.

Explore YouMind
Pour les créateurs

Transformez votre Markdown en un article 𝕏 impeccable

Quand vous publiez vos propres textes longs, la mise en forme 𝕏 des images, tableaux et blocs de code est pénible. YouMind transforme un brouillon Markdown complet en un article 𝕏 impeccable, prêt à publier.

Essayer Markdown vers 𝕏

D'autres patterns à décoder

Articles viraux récents

Explorer plus d'articles viraux