Skip to content

Deployment Overview of Shopify CLI on Server

Prerequisites and Basic Requirements

To successfully deploy the Shopify CLI environment, the server must meet the following operating system and software requirements:

  • Operating System: Debian-based (e.g., Ubuntu) or RHEL-based (e.g., CentOS, Rocky Linux, AlmaLinux).

  • Privileges: Root access or a user with sudo privileges is required to install system packages and manage global Node.js modules.

  • Software Dependencies:

  • curl: Required for downloading installation scripts.

  • git: Required for version control operations.

  • xdg-utils: Required for desktop integration utilities.

  • Ruby Environment:

    • Debian: ruby-full, ruby-dev.

    • RHEL: ruby, ruby-devel.

  • Compilation Tools:

    • Debian: gcc, g++, make.

    • RHEL: @Development Tools.

  • Node.js Version: Node.js version 20 is required and managed via Node Version Manager (nvm).

File and Directory Structure

The deployment utilizes standard user home directory structures for Node.js environments managed by nvm. The key locations include:

  • Node Version Manager (nvm): Installed in the user's home directory at ~/.nvm.

  • Node.js Binaries: Located within ~/.nvm/versions/node/v20.x.x.

  • Global npm Packages: The Shopify CLI is installed globally via npm, typically residing in ~/.nvm/versions/node/v20.x.x/lib/node_modules.

  • Shell Configuration: The ~/.bashrc file is modified to source the nvm script, enabling the nvm command in the shell session.

Application Installation Process

The Shopify CLI is installed globally using the Node Package Manager (npm) after setting up the Node.js runtime environment. The installation process involves the following steps:

  1. Update System Packages:

    • On Debian systems, update and upgrade APT packages.

    • On RHEL systems, ensure the system is up to date.

  2. Install Node Version Manager (nvm):

    • Download and execute the nvm installation script version v0.39.7.

    • Source the ~/.bashrc file to activate nvm in the current session.

  3. Install Node.js:

    • Use nvm to install Node.js version 20.
  4. Install Shopify CLI:

    • Execute the npm command to install the latest version of the Shopify CLI globally.

The specific command sequence executed for the installation is:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 20
npm install -g @shopify/cli@latest

Access Rights and Security

The installation process requires elevated privileges to install system-level dependencies and global npm packages.

  • System Packages: Installation of Ruby, compilers, and utilities requires root or sudo access.

  • Global npm Modules: The npm install -g command installs the Shopify CLI into the global node modules directory, which is accessible to the user running the command.

  • Firewall: No specific firewall rules or port restrictions are defined in the provided configuration for the Shopify CLI itself, as it operates as a command-line tool rather than a network-facing service.

Starting, Stopping, and Updating

The Shopify CLI is a command-line interface tool and does not run as a background service or daemon. Therefore, there are no start, stop, or restart commands for the application itself.

  • Usage: The tool is invoked directly from the terminal using the shopify command after the environment is sourced.

  • Updates: To update the Shopify CLI to the latest version, run the following command:

npm update -g @shopify/cli
  • Node.js Updates: To update the Node.js version managed by nvm, use the nvm install command with the desired version number.
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×