A Laravel package for server management with SSH connectivity, git deployment, monitoring, and log viewing
omniglies/laravel-server-manager is a Laravel package for a laravel package for server management with ssh connectivity, git deployment, monitoring, and log viewing.
It currently has 0 GitHub stars and 19 downloads on Packagist (latest version v1.9.0).
Install it with composer require omniglies/laravel-server-manager.
Discover more Laravel packages by omniglies
or browse all Laravel packages to compare alternatives.
Last updated
A comprehensive Laravel package for server management with SSH connectivity, git deployment, monitoring, and log viewing capabilities.
composer require omniglies/laravel-server-manager
php artisan vendor:publish --tag=config --provider="ServerManager\LaravelServerManager\ServerManagerServiceProvider"
php artisan vendor:publish --tag=migrations --provider="ServerManager\LaravelServerManager\ServerManagerServiceProvider"
php artisan migrate
php artisan vendor:publish --tag=views --provider="ServerManager\LaravelServerManager\ServerManagerServiceProvider"
cd vendor/omniglies/laravel-server-manager/terminal-server
npm install
The package publishes a configuration file to config/server-manager.php. You can customize:
Add these environment variables to your .env file:
# WebSocket Terminal Server
WEBSOCKET_TERMINAL_HOST=localhost
WEBSOCKET_TERMINAL_PORT=3001
WEBSOCKET_TERMINAL_SSL=false
WEBSOCKET_TERMINAL_JWT_SECRET=your-jwt-secret-here
WEBSOCKET_TERMINAL_TOKEN_TTL=3600
WEBSOCKET_TERMINAL_MAX_CONNECTIONS=100
Visit /server-manager in your Laravel application to access the web interface.
The package provides two terminal modes:
Provides complete terminal functionality with interactive programs.
Start the WebSocket server:
# Development
cd vendor/omniglies/laravel-server-manager/terminal-server
npm run dev
# Production
npm start
# Or with PM2
pm2 start server.js --name "terminal-server"
Features:
use ServerManager\LaravelServerManager\Services\SshService;
$sshService = app(SshService::class);
$config = [
'host' => 'your-server.com',
'username' => 'user',
'password' => 'password', // or use 'private_key'
'port' => 22
];
$connected = $sshService->connect($config);
if ($connected) {
$result = $sshService->execute('ls -la');
echo $result['output'];
}
use ServerManager\LaravelServerManager\Services\DeploymentService;
$deploymentService = app(DeploymentService::class);
$config = [
'repository' => 'https://github.com/user/repo.git',
'deploy_path' => '/var/www/html',
'branch' => 'main',
'build_commands' => ['npm install', 'npm run build'],
'post_deploy_commands' => ['php artisan migrate', 'php artisan cache:clear']
];
$result = $deploymentService->deploy($config);
use ServerManager\LaravelServerManager\Services\MonitoringService;
$monitoringService = app(MonitoringService::class);
$status = $monitoringService->getServerStatus();
$processes = $monitoringService->getProcesses(10);
$services = $monitoringService->getServiceStatus(['nginx', 'mysql']);
use ServerManager\LaravelServerManager\Services\LogService;
$logService = app(LogService::class);
$logs = $logService->readLog('/var/log/nginx/error.log', 100);
$searchResults = $logService->searchLog('/var/log/syslog', 'error', 50);
$logFiles = $logService->getLogFiles('/var/log');
The package provides several API endpoints:
GET /server-manager/servers/status - Get server statusPOST /server-manager/servers/connect - Connect to serverPOST /server-manager/servers/disconnect - Disconnect from serverGET /server-manager/servers/processes - Get running processesGET /server-manager/servers/services - Get service statusPOST /server-manager/deployments/deploy - Deploy applicationPOST /server-manager/deployments/rollback - Rollback deploymentGET /server-manager/deployments/status - Get deployment statusPOST /server-manager/terminal/create - Create terminal session (Simple or WebSocket mode)POST /server-manager/terminal/execute - Execute command in Simple modePOST /server-manager/terminal/close - Close terminal sessionPOST /server-manager/terminal/websocket/token - Generate WebSocket authentication tokenPOST /server-manager/terminal/websocket/revoke - Revoke WebSocket tokenGET /server-manager/terminal/websocket/status - Check WebSocket server statusPOST /server-manager/terminal/websocket/start-server - Start WebSocket serverPOST /server-manager/terminal/websocket/stop-server - Stop WebSocket serverGET /server-manager/logs/files - List log filesGET /server-manager/logs/read - Read log fileGET /server-manager/logs/search - Search in log fileGET /server-manager/logs/tail - Tail log fileGET /server-manager/logs/download - Download log filePOST /server-manager/logs/clear - Clear log filePOST /server-manager/logs/rotate - Rotate log fileThe package includes several security features:
Make sure to:
Contributions are welcome! Please feel free to submit a Pull Request.
This package is open-sourced software licensed under the MIT license.
For support, please create an issue in the GitHub repository or contact the maintainers.