An automated tool for renewing Xserver's free VPS service to prevent expiration.
This Python application automatically renews your Xserver free VPS service by simulating the manual renewal process through web scraping. It uses session cookies to authenticate and perform the renewal operation, helping you maintain your free VPS without manual intervention.
- Automated Renewal: Automatically renews your Xserver free VPS service
- Session Management: Uses browser cookies for authentication
- Error Handling: Validates renewal success and provides clear error messages
- Environment Configuration: Secure configuration through environment variables
- User Agent Spoofing: Uses realistic browser headers to avoid detection
- Clone the repository:
git clone https://github.com/fa0311/xserver-auto-renew.git
cd xserver-auto-renew- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
Create a
.envfile in the root directory:
Create a .env file with the following variables:
ID_VPS: Your VPS ID from Xserver (required)USERNAME: Your Xserver account username (required for automatic login)PASSWORD: Your Xserver account password (required for automatic login)
ID_VPS=your_vps_id_here
USERNAME=your_username_or_email_here
PASSWORD=your_password_hereYou have two options for setting up cookies:
Use the automated login script to generate cookies:
python -m xserver-auto-renew.loginThis script will:
- Open a Chrome browser window
- Automatically log in using your credentials from
.env - Generate the
cookies.jsonfile automatically
Note: Make sure you have Chrome installed and accessible in your PATH.
- Log in to your Xserver account in your browser
- Navigate to the VPS management page
- Export cookies for the
secure.xserver.ne.jpdomain - Save the cookies as
cookies.jsonin JSON format
Example cookies.json structure:
[
{
"domain": "secure.xserver.ne.jp",
"name": "X2SESSID",
"path": "/",
"value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
{
"domain": "secure.xserver.ne.jp",
"name": "XSERVER_DEVICEKEY",
"path": "/",
"value": "xxxxxxx"
}
]xserver-auto-renew/
├── xserver-auto-renew/
│ └── ...
├── .env # Environment variables
├── cookies.json # Browser cookies
└── ...
Generate authentication cookies using the automated login:
python -m xserver-auto-renew.loginRun the renewal script:
python -m xserver-auto-renew.mainYou can combine both steps for fully automated operation:
python -m xserver-auto-renew.login && python -m xserver-auto-renew.mainSettings > Secrets and variables > Actions > Repository secrets > New repository secret
Actions

