Documentation
Welcome to ThatWebHostingGuy documentation. Learn how to deploy and manage your static websites.
Quick Start
Get your first site deployed in 3 simple steps:
1. Install the CLI
# Install globally with npm
npm install -g twhg
# Or use npx without installing
npx twhg deploy ./my-site
2. Login to your account
twhg login
This will open your browser to authenticate, or you can use an API key:
twhg login --api-key YOUR_API_KEY
3. Deploy your site
# Deploy the current directory
twhg deploy .
# Deploy a specific folder
twhg deploy ./dist
# Deploy with a custom subdomain
twhg deploy ./build --name my-awesome-site
Your site is now live at https://my-awesome-site.thatwebhostingguy.com
CLI Installation
The TWHG CLI requires Node.js 16 or higher.
# Install with npm
npm install -g twhg
# Verify installation
twhg --version
twhg login
Authenticate with your ThatWebHostingGuy account.
# Interactive browser login
twhg login
# Login with API key
twhg login --api-key twhg_xxxxxxxxxxxx
# Check current login status
twhg whoami
API keys can be generated from your account settings.
twhg deploy
Deploy a directory as a static website.
twhg deploy <directory> [options]
Options:
--name, -n Subdomain name (default: directory name)
--force, -f Overwrite existing site
--message, -m Deployment message/description
Examples:
twhg deploy ./dist
twhg deploy ./build --name my-site
twhg deploy . -f -m "Bug fixes"
twhg sites
List and manage your deployed sites.
# List all sites
twhg sites
# Get details for a specific site
twhg sites my-site
# Output as JSON
twhg sites --json
twhg rollback
Revert to a previous deployment.
# Rollback to previous version
twhg rollback my-site
# Rollback to specific version
twhg rollback my-site --version 3
# List available versions
twhg rollback my-site --list
twhg delete
Delete a deployed site.
# Delete with confirmation
twhg delete my-site
# Force delete without confirmation
twhg delete my-site --force
Custom Domains
Connect your own domain to any site (Starter plan and above).
Setup Steps
- Go to your Dashboard and select your site
- Click "Add Custom Domain"
- Enter your domain (e.g.,
www.example.com) - Add the verification TXT record to your DNS
- Add a CNAME record pointing to your TWHG subdomain
- Click "Verify Domain"
DNS Configuration Example
| Type | Name | Value |
|---|---|---|
| TXT | _twhg-verify | twhg-verify-abc123... |
| CNAME | www | my-site.thatwebhostingguy.com |
Git Deployments
Connect a GitHub repository for automatic deployments on every push.
Setup
- Go to your site settings in the Dashboard
- Click "Connect Repository"
- Enter your GitHub repository URL
- Select the branch to deploy from
- Copy the webhook URL and secret
- Add the webhook to your GitHub repository settings
Build Support
If your repository has a package.json with a build script, it will be automatically executed.
Supported output directories: dist, build, public, out, _site
SSL Certificates
All sites get free SSL certificates automatically via Let's Encrypt.
- Certificates are provisioned within minutes of verification
- Auto-renewed before expiration
- Supports custom domains
- Forces HTTPS redirect
Analytics
Track your site's performance with built-in analytics (Growth plan and above).
- Requests: Total HTTP requests to your site
- Bandwidth: Data transferred
- Unique Visitors: Distinct IP addresses
Teams
Collaborate with team members on your sites (Pro plan and above).
- Invite members by email
- Assign roles: Member or Admin
- Share site access across the team
Two-Factor Authentication
Secure your account with TOTP-based two-factor authentication.
- Go to Account Settings
- Click "Enable 2FA"
- Scan the QR code with your authenticator app
- Enter the verification code
- Save your backup codes securely
API Authentication
Authenticate API requests using your API key.
curl -H "Authorization: Bearer twhg_your_api_key" \
https://www.thatwebhostingguy.com/api/sites
Sites API
List Sites
GET /api/dashboard/sites
Get Site Details
GET /api/dashboard/sites/:id
Delete Site
DELETE /api/dashboard/sites/:id
Deploy API
Deploy a Site
POST /api/deploy
Content-Type: multipart/form-data
Form Data:
- site: ZIP file containing your site
- name: Subdomain name
- description: Optional deployment message