Running commands in your application
Running commands in your application
The Commands tab allows you to execute one-off commands directly in your running application instances. This feature provides a convenient way to perform administrative tasks, run maintenance commands, clear caches, and troubleshoot issues without needing direct server access.
Accessing the Commands feature
To run commands in your application:
- Navigate to your application in the dashboard
- Click on the "Commands" tab
- Select an instance from the dropdown menu
- Enter your command in the command field
- Click "Run" or press Enter to execute the command
The command output will appear immediately below, showing you the results in real-time.
Understanding instances
When your application is running, it may have one or more instances (containers) depending on your scaling configuration. Each instance is an independent copy of your application. The Commands feature lets you select which specific instance to run your command in.
Command execution
How commands work
When you execute a command:
- The command runs inside the selected application instance
- It executes with the same permissions as your application (www-data user)
- The working directory is your application root
- All environment variables and secrets are available
- The command has access to all installed tools and dependencies
Command format
Simply type the command as you would in a terminal. You don't need to prefix commands with special characters - just enter them directly:
php artisan cache:clear
ls -la
composer show
npm list
cat .env
Output display
Command output appears in a terminal-style display showing:
- Standard output (stdout) from successful commands
- Error messages if the command fails
- Exit codes when commands complete
Important considerations
Command persistence
Commands executed through this interface are one-off operations. Any changes made to files will persist (since they're stored in your application's file system), but:
- Running processes started by commands will stop when the command completes
- Background tasks should be managed through proper service configurations
- System-level changes outside the application directory won't persist
Performance impact
Running commands consumes resources from your application instance. For resource-intensive operations:
- Consider running during low-traffic periods
- Monitor your application's performance
- Use dedicated worker instances for heavy tasks
Security
- Commands run with application-level permissions only
- You cannot escalate privileges or access system-level resources