Skip to content

GoHost is a powerful HTTP server tool for Debian Linux, written in Go. It allows you to host websites, serve files, and optionally enable downloads for non-web files. With built-in support for Serveo and Cloudflared tunnels, you can expose your server to the internet and make it accessible from anywhere.

License

Notifications You must be signed in to change notification settings

s-r-e-e-r-a-j/GoHost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoHost

GoHost is a powerful HTTP server tool for Debian Linux, written in Go. It allows you to host websites, serve files, and optionally enable downloads for non-web files. With built-in support for Serveo and Cloudflared tunnels, you can expose your server to the internet and make it accessible from anywhere.

Features

  • Host websites and serve any folder as an HTTP server on Linux.

  • Render .html, .htm, .css, and .js files as websites.

  • When download mode is off, files can only be viewed in the browser by clicking on them.

  • When download mode is on, non-web files can be downloaded by clicking on them.

  • Access your server from anywhere using Serveo or Cloudflared tunnels.

  • Automatically installs SSH (for Serveo) and Cloudflared if missing.

Compatibility

  • Linux (Debian)

Installation

  1. Make sure you have Go installed

  2. Clone the GoHost repository:

git clone https://github.com/s-r-e-e-r-a-j/GoHost.git
  1. Navigate to the GoHost folder:
cd GoHost
  1. Run the installer:
sudo bash install.sh

After installation, you can use gohost from anywhere.

Usage

gohost [options]

Options

Option Description Default Value
-port Port to run the HTTP server 8000
-path Folder path to serve Current directory
-tunnel Tunnel method for internet access (serveo or cloudflared) None (local only)
-download Enable download mode (true or false) false

Examples

  1. Host the current directory on port 8000 (default, view only)
gohost
  1. Host the current directory on a custom port (view only)
gohost -port 8080
  1. Host a specific folder on a custom port (view only)
gohost -port 8080 -path /home/user/files
  1. Host a folder with download mode enabled (non-web files downloadable)
gohost -port 8080 -path /home/user/files -download true
  1. Expose a folder on the internet
# Expose using Serveo 
gohost -port 8080 -path /home/user/files -tunnel serveo

# Expose using Cloudflared 
gohost -port 8080 -path /home/user/files -tunnel cloudflared

# Expose using Cloudflared and enable download mode for non-web files
gohost -port 8080 -path /home/user/files -tunnel cloudflared -download true

Host a Website (HTML/CSS/JS Only)

Requirement: Your folder must contain only .html, .css, and .js files (e.g., index.html, style.css, script.js). No other file types.

# Default port 8000
gohost -path /home/user/website

# Custom port
gohost -port 8080 -path /home/user/website

Expose the website on the internet:

# Serveo
gohost -port 8080 -path /home/user/website -tunnel serveo

# Cloudflared
gohost -port 8080 -path /home/user/website -tunnel cloudflared

Uninstallation

Run uninstall.sh script:

sudo bash uninstall.sh

License

This project is licensed under the MIT License

About

GoHost is a powerful HTTP server tool for Debian Linux, written in Go. It allows you to host websites, serve files, and optionally enable downloads for non-web files. With built-in support for Serveo and Cloudflared tunnels, you can expose your server to the internet and make it accessible from anywhere.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published