Skip to content

A simple and powerful terminal-based tool to manage Linux web servers. Built in Go, it supports popular stacks like Apache, Nginx, and Caddy, with domain and user management features.

License

Notifications You must be signed in to change notification settings

stackroost/stackroost-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stackroost CLI

A powerful command-line interface for managing web servers, domains, SSL certificates, user access, and multi-server deployments across local and remote systems.

Features

  • Domain Management: Add, list, remove, enable, and disable domains with virtual host configurations for Apache, Nginx, and Caddy
  • Web Server Management: Control Apache, Nginx, and Caddy services (start, stop, reload, status)
  • SSL Certificate Management: Issue, renew, revoke SSL certificates via Let's Encrypt or upload manual certificates
  • User Management: Create, modify, and manage system users with SSH access control
  • Remote Server Management: Add remote servers and execute commands via SSH
  • Log Monitoring: View real-time server logs (access and error logs)

Installation

Prerequisites

  • Go 1.25.1 or later
  • sudo access on target systems
  • Web servers (Apache/Nginx/Caddy) installed on target systems
  • Certbot for SSL certificate management

Build from Source

git clone https://github.com/stackroost/stackroost-cli.git
cd stackroost-cli
go build -o stackroost .
sudo mv stackroost /usr/local/bin/

Download Binary

Download the latest release from the releases page and make it executable:

chmod +x stackroost
sudo mv stackroost /usr/local/bin/

Configuration

Stackroost uses a YAML configuration file stored at ~/.stackroost.yaml. The configuration is automatically created and updated as you use the CLI.

You can also specify a custom config file:

stackroost --config /path/to/config.yaml

Usage

Domain Management

Add a new domain

stackroost domain add example.com --server apache

List domains

stackroost domain list

Remove a domain

stackroost domain remove example.com

Enable/Disable domains

stackroost domain enable example.com
stackroost domain disable example.com

Set document root

stackroost domain set-root example.com /var/www/example.com/public

Web Server Management

List installed servers

stackroost server list

Control servers

stackroost server start apache
stackroost server stop nginx
stackroost server reload caddy

Check server status

stackroost server status

SSL Certificate Management

Issue SSL certificate (Let's Encrypt)

stackroost ssl issue example.com --email [email protected]

Renew SSL certificate

stackroost ssl renew example.com

Revoke SSL certificate

stackroost ssl revoke example.com

Upload manual SSL certificate

stackroost ssl upload example.com --cert /path/to/cert.pem --key /path/to/key.pem

List SSL certificates

stackroost ssl list

User Management

Add a new user

stackroost user add john --password mypassword

List users

stackroost user list

Change user password

stackroost user passwd john

Remove a user

stackroost user remove john

Enable/Disable SSH access

stackroost user ssh-enable john
stackroost user ssh-disable john

Remote Server Management

Add a remote server

stackroost remote add myserver [email protected] --key ~/.ssh/id_rsa

List remote servers

stackroost remote list

Execute command on remote server

stackroost remote exec myserver "sudo apt update && sudo apt upgrade"

Log Monitoring

View server logs

stackroost logs --server apache --type access
stackroost logs --server nginx --type error

Supported Web Servers

  • Apache: Full virtual host management, SSL integration
  • Nginx: Virtual host configuration, SSL support
  • Caddy: Basic virtual host setup, automatic SSL (limited CLI control)

Security Notes

  • SSL certificates are managed via Certbot (Let's Encrypt)
  • SSH connections use key-based authentication
  • All server management commands require sudo privileges
  • Configuration files are stored securely in the user's home directory

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This tool requires administrative privileges and can modify system configurations. Use with caution and ensure you have backups of your configurations before making changes.

About

A simple and powerful terminal-based tool to manage Linux web servers. Built in Go, it supports popular stacks like Apache, Nginx, and Caddy, with domain and user management features.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published