Warning! ONLY for use on new servers with Ubuntu and Fedora
Warning! Crucible is in alpha-stage. Expect bugs and errors
Crucible is an opinionated and lightweight terminal server management tool.
Crucible is a terminal-based tool (TUI) built with Bubble Tea that simplifies setting up Ubuntu or Fedora servers for Laravel applications. It provides an interactive menu to install and configure all necessary components for a production Laravel environment.
- PHP Management: Install PHP 8.4 with option to upgrade to PHP 8.5 (alpha-release)
- Composer: Install PHP Composer for dependency management
- MySQL: Install MySQL server with best practice configurations
- Caddy Server: Install and configure Caddy with Laravel-optimized settings
- Git CLI: Install Git for version control
- Laravel Site Management:
- Create new Laravel sites in
/var/www - Pull Laravel projects from GitHub repositories
- Update existing Laravel sites with
git pull
- Create new Laravel sites in
- Database Backup: Backup MySQL databases over SSH to local machines
- System Status: Monitor the health of all installed services
- Logging: Uses Charm Log for comprehensive logging
- Ubuntu (18.04+)
- Fedora (30+)
- Go 1.21 or higher
- Root/sudo access on the target server
- SSH access for database backups (optional)
- Clone or download the project:
git clone <repository-url>
cd crucible- Install dependencies:
go mod tidy- Build the application:
go build -o crucible- Run with sudo privileges:
sudo ./crucibleLaunch Crucible and use the interactive menu to:
- Install Components: Start by installing PHP, Composer, MySQL, Caddy, and Git
- Create Laravel Sites: Set up new Laravel applications with domain configuration
- Manage Sites: Update existing sites and manage deployments
- Monitor System: Check service status and site health
- Backup Data: Create and transfer MySQL backups
- Use ↑/↓ or k/j to navigate the menu
- Press Enter or Space to select an option
- Press q or Ctrl+C to quit
Sites are created in /var/www/[site-name] with proper permissions:
- Owner:
www-data:www-data - Directories:
755 - Files:
644 - Storage/Cache:
775
Crucible creates optimized Caddy configurations for Laravel:
- PHP-FPM integration with Unix sockets
- Security headers (XSS, CSRF protection)
- Gzip compression
- Static file serving
- Laravel-specific URL rewriting
- Main Caddyfile:
/etc/caddy/Caddyfile - Laravel snippet:
/etc/caddy/snippets/laravel.caddy - Site configs:
/etc/caddy/sites/[domain].caddy
Crucible configures MySQL with security best practices:
- Runs
mysql_secure_installation - Enables automatic startup
- Optimizes for Laravel workloads
The project is structured as follows:
main.go: Main application and UI logicinstall.go: Component installation functionslaravel.go: Laravel site managementutils.go: Backup, status, and utility functions
- Bubble Tea: TUI framework
- Lipgloss: Terminal styling
- Charm Log: Structured logging
- Always run with appropriate privileges
- Secure MySQL installations with strong passwords
- Configure firewalls appropriately
- Use HTTPS in production with proper SSL certificates
- Regularly update system packages and PHP versions
- Permission Denied: Ensure you're running with sudo privileges
- Package Not Found: Update package repositories before installation
- Service Start Failures: Check system logs with
journalctl - Caddy Configuration Errors: Validate syntax with
caddy validate
Crucible uses structured logging. Check the output for detailed information about operations and any errors encountered.
Use the "System Status" option in the menu to check:
- Service installation status
- Service health
- Available Laravel sites
- Disk usage
Contributions are welcome! Please ensure:
- Code follows Go conventions
- All functions include proper error handling
- Log important operations and errors
- Test on both Ubuntu and Fedora
This project is open source and available under the MIT License.
For issues and questions:
- Check the troubleshooting section
- Review system logs
- Ensure proper permissions and prerequisites
Dockerfile --- DO NOT USE IN PRODUCTION ----
FROM fedora:latest
RUN echo 'root:your_secret_password' | chpasswd
RUN dnf update -y &&
dnf install -y
nano
sudo
git
curl
wget &&
dnf clean all
sudo docker build -t my-fedora-server . sudo docker run -it --privileged my-fedora-server /usr/sbin/init
wget https://github.com/ekrist1/crucible/archive/refs/heads/main.zip dnf install unzip unzip main.zip cd crucible-main chmod +x crucible sudo ./crucible