![Nanobox CLI Commands Techhyme](https://techhyme.com/wp-content/uploads/2023/07/Nanobox-CLI-Commands-Techhyme-1024x501.jpg)
Nanobox is a powerful development platform that simplifies the process of deploying, managing, and scaling applications. It provides a user-friendly Command-Line Interface (CLI) that enables developers to interact with their applications and environments efficiently.
In this guide, we will explore the various Nanobox CLI commands and how they can be used to streamline your development workflow.
- Update and Basic Commands
- Update Nanobox CLI
- Start Local Environment
- Build App’s Runtime
- Compile App’s Code
- Managing Connections and Deployments
- Manage Remote Connections
- Deploy Your App
- Interacting with Live Apps
- Open Interactive Terminal
- App Information and Logs
- Secure Tunnel
- Environment Variables and DNS Management
- Manage Environment Variables
- Manage DNS Aliases for Local Applications
- Configuration and Cleanup
- Configure Nanobox
- Clean and Destroy
- Miscellaneous Commands
- Other Useful Commands
- Help and Debug
Update and Basic Commands
1. Update Nanobox CLI:
nanobox-update
This command updates your Nanobox CLI to the most recent version, ensuring you have access to the latest features and bug fixes.
2. Start Local Environment:
nanobox run [<command>]
The `run` command starts your local environment and allows you to run your application. You can also specify a command to run within the environment.
3. Build App’s Runtime:
nanobox build
Use this command to build your application’s runtime, which prepares it for deployment.
4. Compile App’s Code:
nanobox compile
The `compile` command compiles your application’s code into a deployable package.
Managing Connections and Deployments
5. Manage Remote Connections:
nanobox remote add <app-name> [<remote-alias>]
nanobox remote rm <remote-alias>
nanobox remote ls
These commands manage connections to remote applications. You can add, remove, and list remote connections.
6. Deploy Your App:
nanobox deploy [<dry-run | {remote-alias}>] [-m <message>]
The `deploy` command allows you to deploy your application to a live environment. You can specify a dry-run or a specific remote alias and include an optional deployment message.
Interacting with Live Apps
7. Open Interactive Terminal:
nanobox console [<local | dry-run | {remote-alias}>] <component.id>
Use the `console` command to open an interactive terminal from inside a component in your live application.
8. App Information and Logs:
nanobox info [<local | dry-run | {remote-alias}>]
nanobox log [<dry-run | {remote-alias}>]
The `info` command displays information about the app and its components, while the `log` command allows you to view and stream application logs.
9. Secure Tunnel:
nanobox tunnel [<remote-alias>] <component.id> [-p <local-port>[:[<remote-port>]]]
The `tunnel` command establishes a secure tunnel from your local machine to a running service, enabling secure access to specific components.
Environment Variables and DNS Management
10. Manage Environment Variables:
nanobox evar add [<local | dry-run | {remote-alias}>] <key1>=<value1> <key2>=<value2>
nanobox evar load [<local | dry-run | {remote-alias}>] path/to/file
nanobox evar rm [<local | dry-run | {remote-alias}>] <key1> <key2>
nanobox evar ls [<local | dry-run | {remote-alias}>]
These commands allow you to manage environment variables on your production environment.
11. Manage DNS Aliases for Local Applications:
nanobox dns add <local | dry-run> <hostname>
nanobox dns rm <local | dry-run> <hostname>
nanobox dns ls <local | dry-run>
The `dns` commands let you manage DNS aliases for local applications.
Configuration and Cleanup
12. Configure Nanobox:
nanobox config set <config-key> <config-value>
nanobox config get <config-key>
nanobox config ls
Use these commands to configure Nanobox settings according to your requirements.
13. Clean and Destroy:
nanobox clean
nanobox destroy [<local | dry-run>]
The `clean` command removes any environments that no longer exist, while `destroy` removes the current project from Nanobox.
Miscellaneous Commands
14. Other Useful Commands:
nanobox start
nanobox stop
nanobox status
nanobox implode
nanobox version
These commands handle starting, stopping, and checking the status of Nanobox and its apps. The `implode` command removes all Nanobox-created containers, files, and data.
15. Help and Debug:
--help
--debug
-t, --trace
-v, --verbose
-f, --force
These options provide help information, debug context, and increase display output levels for debugging purposes.
The Nanobox CLI offers a comprehensive set of commands that facilitate the development and deployment of applications. By leveraging these commands, developers can efficiently manage their environments, access logs, and seamlessly deploy their apps to production. Nanobox empowers developers to focus on coding, while it handles the complexities of the deployment process.
Happy coding with Nanobox!
You may also like:- Essential Commands For Process Management in Kali Linux
- A Comprehensive Guide to File System Commands in Linux
- Essential File Compression Commands in Linux
- Secure Shell (SSH) Protocol – A Comprehensive Guide
- Monitoring Active Connections in Kali Linux Using Netstat
- Manage Time and Date in Linux with timedatectl
- How to Add a User to Sudoers on Ubuntu
- 25 Popular Linux IP Command Examples
- Top 11 Nmap Commands for Remote Host Scanning
- 9 Useful w Command Examples in Linux