Applications in Andasy
Learn how to create and manage applications in Andasy.
Applications are the building blocks of Andasy. They represent your deployed projects running on the Andasy platform. An application is essentially a logical grouping that contains your code, configuration, and the machines (virtual servers) that run it.
What is an Application?
In Andasy, an application is a containerized service that you deploy and manage. Think of it as your project's identity on the platform. It has a name, configuration, and can have one or more machines running instances of your code.
Key characteristics of applications:
- One codebase, one application - Each application typically corresponds to a single codebase or service
- Shared configuration - All machines in an application share the same configuration (defined in
andasy.hcl) - Independent lifecycle - Each application can be deployed, updated, restarted, or deleted independently
Application Lifecycle
- Create - Register your application with Andasy (often done automatically by
andasy setup) - Configure - Define settings in
andasy.hcl(resources, ports, environment variables) - Deploy - Build and deploy your code to machines
- Manage - Monitor, restart, or update your application as needed
Applications vs Machines
It's helpful to understand the relationship between applications and machines:
- Application = The logical service (e.g., "my-api", "web-frontend")
- Machine = A virtual server instance running your application code
When you deploy an application, Andasy creates at least one machine to run it. You can then add more machines as needed. See the Machines documentation for details on managing individual machine instances.
Creating an Application
To create an application using the Andasy CLI, run the following command in your terminal:
andasy apps create
This command will prompt you to enter the name of the application and the organization that you want to associate the application with. Once you have entered this information, the application will be created, and you will be added as the owner.
Managing an Application
Applications can be managed using the Andasy CLI. You can view a list of all the applications associated with your account, as well as view detailed information about a specific application.
To view a list of all the applications in a particular organization, run the following command:
andasy apps list
This command will prompt you to select an organization from a list of organizations associated with your account. Once you have selected an organization, a list of all the applications associated with that organization will be displayed.
Show an app
To view detailed information about a specific application, run the following command:
andasy apps show -a <app-name>
Replace <app-name> with the name of the application that you want to view detailed information about. if you currently are in the root directory of the application, you can omit the -a flag as long as a andasy.hcl file exists in the root directory.
Restarting an Application
In some cases, you may need to restart an application that is experiencing issues or has stopped responding. You can restart an application using the Andasy CLI by running the following command:
andasy apps restart -a <app-name>
Replace <app-name> with the name of the application that you want to restart. if you currently are in the root directory of the application, you can omit the -a flag as long as a andasy.hcl file exists in the root directory.
Delete an app
The delete command permanently removes an application and all associated resources. This includes:
- All machines running the application
- All volumes attached to the application
- All configuration and metadata
Warning:
This action is irreversible. Once deleted, you cannot recover the application, its data, or its volumes. Make sure you have backups of any important data before deleting an application.
andasy apps delete -a <app-name>
Replace <app-name> with the name of the application that you want to delete. If you currently are in the root directory of the application, you can omit the -a flag as long as a andasy.hcl file exists in the root directory.