Introduction
When writing articles, I often need to insert images (though I haven’t used many lately). Hosting them on your own server consumes quite a bit of bandwidth, and the loading speeds aren’t always great. This is where image hosting comes in. However, most free image hosts suffer from disappearing images or slow speeds, so I started looking into self-hosted solutions.
Renting a dedicated cloud server just for images is too expensive, and most paid image hosts have traffic or storage limits. Eventually, I stumbled upon a project: an image hosting management tool based on GitHub API & jsDelivr that features built-in CDN acceleration.
About PicX
Official Website: PicX Image Hosting
Project Address: XPoet/picx: An image hosting management tool based on GitHub API & jsDelivr with CDN acceleration
Official Documentation: Quick Start - PicX
Features: Just choose a GitHub repository as your storage, then complete the Token binding and configuration on the PicX official website . No download or installation required. It’s that simple.
Quick Start
1. Create a New GitHub Repository
Click this link: Create a New Repository
Enter a Repository name (e.g., image-hosting).
The repository visibility must be set to Public.
2. Create a GitHub Token with repo Permissions
Click this link: New personal access token
Fill in the Note (e.g., picx-image-hosting).
Note: “Expiration” is the validity period of this Token. Please choose carefully. If you encounter issues later because you didn’t set this correctly, refer to: Using PicX to upload images prompts “Bad credentials” – yexca’Blog
Under Select scopes, check the repo box, then click Create Token.
Warning: The newly generated Token is only displayed once. Save it securely. If you lose it, you’ll need to regenerate it.
3. Configure the Token on the Official Site
Open the PicX Website , go to the image hosting configuration, and paste your Token.
Then, choose your repository and directory style:
- New Directory: Manually enter a new directory name. (Use
/for multi-level directories, e.g.,A01/A02. Supports up to three levels.) - Root Directory: Images will be stored directly in the repository’s root.
- Auto Directory: Automatically generates directories based on the date format
YYYYMMDD(e.g.,20200909).
That’s it! Your image host is configured and ready to use.
Others
Image compression is enabled by default. You can modify this in “My Settings.”