Deployment Overview of Shopify CLI on Server¶
Prerequisites and Basic Requirements¶
To successfully deploy the Shopify CLI on the server, ensure the following system requirements are met:
-
Operating System: Debian-based (Ubuntu, Debian) or RHEL-based (CentOS, Rocky Linux, AlmaLinux) distributions.
-
Privileges: Root access or a user account with
sudoprivileges is required to install system packages and global Node.js modules. -
Network Access: The server must have outbound internet access to download installation scripts, Node.js binaries, and package dependencies from remote repositories.
-
Dependencies: The installation process automatically pulls in specific development tools including Ruby, compilers, and Git.
File and Directory Structure¶
The deployment utilizes the standard user home directory structure for the Node.js environment and system-wide paths for global package installation. The key locations include:
-
Node Version Manager (nvm): Installed in the user's home directory at
~/.nvm. -
Node.js Binaries: Installed by nvm within
~/.nvm/versions/node/v20.0.0(or latest patch of v20). -
Global NPM Modules: Installed to the standard global NPM path, accessible via the user's environment after sourcing the profile.
-
System Packages: Ruby and development tools are installed in standard system paths (
/usr/bin,/usr/lib, etc.).
Application Installation Process¶
The Shopify CLI is installed globally using the Node Package Manager (NPM) after setting up Node.js version 20 via the Node Version Manager. The installation process differs slightly based on the operating system family.
Debian-based Systems¶
The installer performs the following steps:
-
Updates and upgrades APT package repositories.
-
Downloads and installs nvm version
0.39.7. -
Sources the shell configuration to activate nvm.
-
Installs Node.js version
20. -
Installs the latest version of the Shopify CLI globally.
The specific command executed for the Node.js and CLI setup is:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && . ~/.bashrc && nvm install 20 && npm install -g @shopify/cli@latest
RHEL-based Systems¶
The installer performs the following steps:
-
Installs system dependencies including "@Development Tools", Ruby, and Ruby development libraries.
-
Downloads and installs nvm version
0.39.7. -
Sources the shell configuration to activate nvm.
-
Installs Node.js version
20. -
Installs the latest version of the Shopify CLI globally.
The specific command executed for the Node.js and CLI setup 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
System Dependencies¶
The deployment script installs the following additional requirements for theme development:
| Package Name | Description |
|---|---|
ruby-full / ruby | Ruby interpreter required for Shopify theme processing. |
ruby-dev / ruby-devel | Ruby development headers for compiling native extensions. |
gcc / g++ | GNU Compiler Collection for C/C++ compilation. |
make | Build automation tool. |
git | Version control system for managing theme repositories. |
curl | Tool for transferring data from the web. |
xdg-utils | Utilities for interacting with the desktop environment (opening files in browser). |
@Development Tools | Meta-package on RHEL systems providing essential build tools. |
Access Rights and Security¶
The installation script requires elevated privileges to modify system package repositories and install global packages.
-
Package Management:
aptoryumcommands require root access to install or update system libraries. -
Global NPM Installation: Installing
@shopify/cliglobally vianpm install -grequires write access to the NPM global directory, typically achieved by running the command as root or a user withsudo. -
Shell Configuration: The installation modifies the user's shell configuration files (
.bashrc) to include the nvm initialization script.
Databases¶
The Shopify CLI is a command-line tool for interacting with the Shopify platform. It does not include a local database component as part of this specific deployment configuration. All data persistence and theme storage are handled remotely via the Shopify admin API or local file system operations managed by the user.
Docker Containers and Their Deployment¶
This deployment does not utilize Docker containers. The Shopify CLI is installed as a native Node.js application on the host server operating system.
Proxy Servers¶
The deployment configuration does not include a proxy server such as Nginx, Traefik, or a custom SSL termination layer. The tool operates as a local command-line interface and communicates directly with Shopify's remote servers.
Permission Settings¶
The installation process sets permissions based on the standard behavior of the package managers and NPM:
-
System Packages: Installed in
/usr/binand/usr/libwith root ownership. -
User Environment: Files in the user's home directory (
~/.nvm,~/.bashrc) are owned by the executing user. -
Global Modules: Installed in the global NPM directory; ownership depends on the privilege level used during the
npm installcommand.
Location of Configuration Files and Data¶
-
nvm Configuration: The initialization script is appended to
~/.bashrc. -
Node Version: Controlled by nvm in the
~/.nvmdirectory. -
Shopify CLI: Located within the global NPM modules directory, accessible via the
shopifycommand after loading the nvm environment. -
Theme Data: Stored in user-defined local directories within the server's filesystem, as configured by the user during development workflows.
Available Ports for Connection¶
The Shopify CLI does not open local listening ports for incoming connections by default. It initiates outbound HTTPS connections to Shopify's API endpoints (port 443) for authentication, theme pushing, and other operations.
Starting, Stopping, and Updating¶
The Shopify CLI is a user-space application and is not managed as a system service (systemd).
-
Starting: The CLI is started by invoking the
shopifycommand in the terminal after sourcing the shell environment. -
Stopping: The process terminates when the user exits the command or closes the terminal session.
-
Updating: To update the CLI to the latest version, the following command is used: