Ubuntu - Installation Guide

This guide provides comprehensive instructions for setting up the PrestaShop Enterprise Developer Tools on Ubuntu systems. Follow these steps carefully to ensure a proper installation and configuration.

System Requirements

Minimum Requirements

  • Operating System: Ubuntu 20.04 LTS or later (22.04 LTS recommended)
  • RAM: 8 GB minimum (16 GB recommended)
  • Storage: 10 GB free disk space minimum
  • Network: Internet connection for downloading packages and accessing repositories

Required Software

Before installing the Enterprise Developer Tools, you’ll need:

  • Docker and Docker Compose
  • Git version control system
  • SSH key pair for GitLab access
  • PrestaShop Enterprise Platform account

Prerequisites Setup

Step 1: Update System Packages

Start by updating your system to ensure you have the latest packages and security updates.

  1. Update package lists:

    sudo apt update
    
  2. Upgrade installed packages:

    sudo apt upgrade -y
    
  3. Install essential build tools (optional but recommended):

    sudo apt install -y curl wget unzip build-essential
    

Step 2: Install Docker and Docker Compose

Docker is essential for containerizing the PrestaShop environments and managing dependencies.

Install Docker

  1. Install Docker from Ubuntu repositories:

    sudo apt install -y docker.io docker-compose-v2 docker-buildx-plugin
    
  2. Start and enable Docker service:

    sudo systemctl start docker
    sudo systemctl enable docker
    
  3. Verify Docker installation:

    sudo docker --version
    sudo docker run --rm hello-world
    

Configure Docker Permissions

To run Docker commands without sudo, add your user to the docker group:

  1. Add user to docker group:

    sudo usermod -aG docker $USER
    
  2. Apply group changes:

    newgrp docker
    
  3. Test Docker without sudo:

    docker run --rm hello-world
    
Important: If the test command fails, you may need to log out and log back in, or restart your system for the group changes to take effect completely.

Alternative: Install Docker from Official Repository

For the latest Docker version with additional features:

  1. Remove old Docker versions:

    sudo apt remove -y docker docker-engine docker.io containerd runc
    
  2. Install prerequisites:

    sudo apt install -y ca-certificates curl gnupg lsb-release
    
  3. Add Docker’s official GPG key:

    sudo mkdir -p /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    
  4. Set up Docker repository:

    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
  5. Install Docker Engine:

    sudo apt update
    sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
    

Step 3: Install Git

Git is required for source code management and accessing GitLab repositories.

  1. Install Git:

    sudo apt install -y git
    
  2. Verify Git installation:

    git --version
    
  3. Configure Git (replace with your information):

    git config --global user.name "Your Name"
    git config --global user.email "your.email@example.com"
    
  4. Configure Git for better collaboration:

    # Set default branch name
    git config --global init.defaultBranch main
    
    # Set pull behavior to rebase
    git config --global pull.rebase true
    
    # Enable credential helper
    git config --global credential.helper store
    

Step 4: Generate SSH Keys

SSH keys provide secure authentication to GitLab repositories without passwords.

Generate the SSH Key

  1. Create SSH key pair:

    ssh-keygen -t ed25519 -C "PC Ubuntu"
    
  2. Configure the key generation:

    • File location: Press Enter to accept the default path (/home/$USER/.ssh/id_ed25519)
    • Passphrase: Enter a secure passphrase or press Enter to skip
    • Note the output: The system will show where your keys are saved:
      Your public key has been saved in /home/<username>/.ssh/id_ed25519.pub
      

Copy the Public Key

  1. Display the public key:

    cat ~/.ssh/id_ed25519.pub
    
  2. Copy the entire output to your clipboard

Add Key to GitLab

  1. Login to GitLab:

    • Visit GitLab Login
    • Use your enterprise.prestashop.com credentials
  2. Navigate to SSH Keys:

  3. Add the new key:

    • Click “Add new key”
    • Paste your public key content in the “Key” field
    • Add a descriptive title (e.g., “Ubuntu Development Machine”)
    • Remove the expiration date (set to “No expiration”)
    • Click “Add key”

Test SSH Connection

  1. Test GitLab SSH connection:

    ssh -T git@git.hyperlane.co
    
  2. Expected response: You should see a welcome message from GitLab confirming successful authentication.

SSH Agent: If you used a passphrase, consider setting up SSH agent to avoid entering it repeatedly:

# Start SSH agent
eval "$(ssh-agent -s)"

# Add your key to the agent
ssh-add ~/.ssh/id_ed25519

Step 5: Install Additional Tools (Optional)

These tools can enhance your development experience:

Install Node.js and npm

Useful for some PrestaShop development tasks:

# Install Node.js LTS
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs

# Verify installation
node --version
npm --version

Install VS Code (Optional)

For code editing and development:

# Download and install VS Code
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
sudo apt install -y code

Installation

Download and Install Enterprise Developer Tools

  1. Create and navigate to your working directory:

    mkdir -p ~/prestashop-development
    cd ~/prestashop-development
    
  2. Download the binary:

    wget "https://assets.prestashop3.com/enterprise/tools/ubuntu/ps-enterprise.zip"
    
  3. Extract the files:

    unzip ps-enterprise.zip
    
  4. Clean up:

    rm ps-enterprise.zip
    
  5. Make executable and install system-wide:

    chmod +x ps-enterprise
    ./ps-enterprise install
    
  6. Restart your terminal or source your shell profile:

    # For bash users
    source ~/.bashrc
    
    # For zsh users
    source ~/.zshrc
    
  7. Verify installation:

    ps-enterprise -v
    

First Startup and Configuration

Initial Setup Process

  1. Navigate to your project directory:

    cd ~/prestashop-development
    # Or create a new project directory
    mkdir MyPrestaShopProject && cd MyPrestaShopProject
    
  2. Run the initial setup:

    ps-enterprise
    

Authentication Process

  1. Web Authentication:

    • A web browser will automatically open
    • If not, the terminal will display a URL to visit manually
    • Login using your PrestaShop Enterprise Platform credentials
    • Email: Same as your enterprise.prestashop.com account
    • Password: May differ from your enterprise.prestashop.com password
  2. Complete authentication and return to the terminal

Configuration Setup

  1. Project and Environment Selection:

    • Select your target project from the list
    • Choose the environment you want to work with
    • Configure any specific settings as prompted
  2. Local Environment Configuration:

    • The tool will automatically configure your local environment
    • Docker containers will be set up with proper permissions
    • Database connections will be established
First Startup Note: The initial setup may take 5-10 minutes as Docker downloads necessary images and configures the environment. This is normal behavior.

Verification and Testing

Test Your Installation

  1. Check all components:

    # Test ps-enterprise
    ps-enterprise -v
    
    # Test Docker
    docker --version
    docker run --rm hello-world
    
    # Test Git
    git --version
    
    # Test Docker Compose
    docker compose version
    
  2. Verify SSH connection:

    ssh -T git@git.hyperlane.co
    

    You should see a welcome message from GitLab.

  3. Test Docker permissions:

    # This should work without sudo
    docker ps
    

Common Issues and Solutions

Docker Issues

Problem: “Permission denied” when running Docker commands

# Solution: Ensure user is in docker group
sudo usermod -aG docker $USER
newgrp docker

# Or restart your session
logout
# Then log back in

Problem: “Docker daemon is not running”

# Solution: Start Docker service
sudo systemctl start docker
sudo systemctl enable docker

# Check status
sudo systemctl status docker

SSH Issues

Problem: SSH connection to GitLab fails

# Check SSH agent
ssh-add -l

# Add key if needed
ssh-add ~/.ssh/id_ed25519

# Test with verbose output
ssh -vT git@git.hyperlane.co

Problem: “Host key verification failed”

# Add GitLab to known hosts
ssh-keyscan git.hyperlane.co >> ~/.ssh/known_hosts

Git Issues

Problem: Git authentication fails

# Configure Git credentials
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

# Test Git over SSH
git clone git@git.hyperlane.co:path/to/test-repo.git

Network Issues

Problem: Cannot download packages or connect to repositories

# Check network connectivity
ping google.com

# Check DNS resolution
nslookup git.hyperlane.co

# Update package lists
sudo apt update

Performance Optimization

System Optimization Tips

  1. Increase file watchers limit (for development):

    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
    sudo sysctl -p
    
  2. Optimize Docker performance:

    # Add to ~/.bashrc or ~/.zshrc
    echo 'export DOCKER_BUILDKIT=1' >> ~/.bashrc
    echo 'export COMPOSE_DOCKER_CLI_BUILD=1' >> ~/.bashrc
    source ~/.bashrc
    
  3. Configure memory limits for Docker:

    # Edit Docker daemon configuration
    sudo mkdir -p /etc/docker
    echo '{
      "log-driver": "json-file",
      "log-opts": {
        "max-size": "10m",
        "max-file": "3"
      }
    }' | sudo tee /etc/docker/daemon.json
    
    sudo systemctl restart docker
    

Next Steps

After successful installation and configuration:

  1. Explore the tools: Run ps-enterprise --help to see available commands
  2. Set up your first project: Use ps-enterprise to clone and configure a shop
  3. Read the documentation: Familiarize yourself with the Command Reference
  4. Configure your IDE: Set up your preferred development environment
  5. Join the community: Connect with other PrestaShop developers

Getting Help

If you encounter issues:

  1. Check system logs:

    # Check Docker logs
    sudo journalctl -u docker.service
    
    # Check system logs
    sudo journalctl -xe
    
  2. Verify prerequisites: Ensure all components are properly installed

  3. Restart services: Try restarting Docker and your terminal

  4. Contact support: Reach out to your PrestaShop Enterprise support team

Troubleshooting Commands

Quick reference for common troubleshooting commands:

# System information
uname -a
lsb_release -a

# Docker information
docker info
docker system df

# Network connectivity
ping -c 4 git.hyperlane.co
curl -I https://assets.prestashop3.com

# Process information
ps aux | grep docker
ps aux | grep ps-enterprise

# File permissions
ls -la ~/.ssh/
ls -la /var/run/docker.sock

Summary

You now have a complete Ubuntu development environment for PrestaShop Enterprise development. The setup includes:

  • ✅ Updated Ubuntu system with essential packages
  • ✅ Docker and Docker Compose with proper permissions
  • ✅ Git with SSH key authentication
  • ✅ PrestaShop Enterprise Developer Tools
  • ✅ Optimized system configuration for development

Your Ubuntu machine is ready for PrestaShop Enterprise development!