The command-line tools in Liferay Cloud contribute to the developer’s workflow by delivering speed, control, traceability, scripting, and automation capabilities. Shell access makes it simpler to see what’s going on inside your application. For example, you can use the shell to look for side effects not easily spotted in the logs. You can also call functions for data population or report generation that are meant to run only once.
The backup and database services do not provide shell access.
Accessing the Shell via the Web Console
Follow these steps to access the shell via the Liferay Cloud web console:
- Go to your environment page.
- Click Services in the menu on the left.
- Select the service you want to access, then click the Shell tab.
Accessing the Shell via a Terminal
Follow these steps to access your service’s shell via a terminal:
- Install the Liferay Cloud command line tool, if it’s not already installed.
- Run the command
lcp shell, then select the service to access.
- Run any command that you want.
Alternatively, if you already know which service and project you want to access, you can run this command instead:
lcp shell -p projectID -s serviceID
The shell is a great tool to troubleshoot or perform one-time actions on your service, but it’s not intended for permanent changes. When you deploy or restart your service, all files not in a persistent volume are replaced by the new build. For the shell, this means every command you run on your service is temporary and will reset when you redeploy or restart your service, unless you make the changes within a volume.