How to Set Up an Image Hosting Webserver Using ShareX
If you want a fast, custom image uploader for your own website or community, setting up an image hosting webserver with ShareX on a dedicated server is a fantastic choice. This guide walks you through everything you need—from server setup to configuring ShareX—so you can start uploading images with your own domain in no time.
Why Use ShareX with Your Own Image Hosting Server?
ShareX is a powerful, open-source Windows program designed for screen capture and file sharing. Paired with your own server, it allows you to:
- Upload images directly to your server
- Manage files privately or publicly
- Get custom URLs for easy sharing
- Avoid third-party upload limits or ads
Prerequisites: What You Need Before Starting
Before you get your hands dirty, make sure you have:
- A domain name (e.g.,
img.example.com) pointed to your server’s IP address - A dedicated server running CentOS 7.x (this guide assumes CentOS but can be adapted)
- ShareX installed on a Windows PC (download from getsharex.com)
- Basic SSH knowledge to connect and manage your server
Step 1: Connect to Your Server and Install Dependencies
Use SSH to log into your dedicated server and install the necessary software. Run these commands:
bashCopyyum update -y
yum install epel-release -y
yum install nginx -y
yum install firewalld -y
- nginx will serve your files via HTTP
- firewalld manages firewall rules
Step 2: Start and Enable Services
Now start and enable nginx and firewalld to run on boot:
bashCopysystemctl start nginxsystemctl enable nginx
systemctl start firewalldsystemctl enable firewalld
Allow HTTP traffic through the firewall:
bashCopyfirewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --reload
Step 3: Configure NGINX to Serve Your Image Hosting Domain
Tell nginx where to find your image files by creating a config file. Replace img.example.com with your actual domain:
bashCopycd /etc/nginx/conf.d
nano img.example.com.conf
Paste the following configuration:
nginxCopyserver { listen 80; server_name img.example.com; root /var/www/img.example.com/; index index.php index.html;
}
Save and exit (Ctrl+X, then Y, then Enter).
Reload nginx to apply the changes:
bashCopysystemctl reload nginx
Step 4: Configure ShareX to Upload to Your Server
On your Windows PC, open ShareX and:
- Fill out the FTP uploader form:
- Host: Your server’s IP or domain (e.g.,
img.example.com) - Username: Your FTP username
- Password: Your FTP password
- Host: Your server’s IP or domain (e.g.,
- Click Test Connection. It should say Connection Established.
Remote path: Leave default or specify a folder (e.g., /)

Under File Uploaders, choose FTP / SFTP Uploader

Go to Destination Settings

Step 5: Use ShareX to Upload Images
- Close the settings
- Click Destinations → Image Uploaders → File Uploader → FTP
- Now, when you take screenshots or upload files, ShareX sends them directly to your server, generating clean URLs for sharing.
Bonus Tips & Troubleshooting
- Make sure your domain's DNS A record points to your dedicated server’s IP.
- The server folder
/var/www/img.example.com/must exist and be writable by the nginx user. Create it with:bashCopymkdir-p /var/www/img.example.comchown-R nginx:nginx /var/www/img.example.com - For security, consider enabling SFTP and using SSH keys instead of plain FTP.
- If you want HTTPS, consider setting up Let's Encrypt certificates using Certbot.
Summary
With your dedicated server, domain, and ShareX configured, you now have a powerful image hosting solution that’s fully under your control. Enjoy fast uploads, custom URLs, and freedom from third-party restrictions!