### Install Composer Dependencies Source: https://vitodeploy.com/docs/next/getting-started/installation Installs all project dependencies defined in the composer.json file. This is a standard step after cloning a PHP project. ```bash composer install ``` -------------------------------- ### Laravel Sail: Initial Setup and Application Boot Source: https://vitodeploy.com/docs/2.x/getting-started/installation Commands to set up the .env file, install dependencies, and boot the application using Laravel Sail for local development. Requires cloning the repository and having Composer installed. ```bash cp .env.sail .env composer install ./vendor/bin/sail up -d ``` -------------------------------- ### Manual VPS Upgrade: Redis Installation and Configuration Source: https://vitodeploy.com/docs/prologue/upgrade Installs and enables the Redis server on a VPS, which is required for VitoDeploy 3.x for caching, sessions, and queues. Ensures Redis is running and enabled to start on boot. ```bash sudo apt install redis-server -y sudo service redis enable sudo service redis start ``` -------------------------------- ### Start Laravel Sail Application Source: https://vitodeploy.com/docs/next/getting-started/installation Boots up the Laravel Sail development environment in detached mode. This command starts all necessary Docker containers for the application. ```bash ./vendor/bin/sail up -d ``` -------------------------------- ### VitoDeploy Installation Script for VPS Source: https://vitodeploy.com/docs/next/getting-started/installation Installs VitoDeploy on a fresh Ubuntu server via SSH. Requires root user and specific server requirements. The script prompts for admin email and password, or these can be passed as environment variables. ```bash bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/3.x/scripts/install.sh) ``` -------------------------------- ### Install Node.js (Bash) Source: https://vitodeploy.com/docs/next/prologue/upgrade Installs Node.js version 22.x, which is a requirement for Vito v3 using Inertia.js. This script fetches the NodeSource setup script and then installs Node.js using apt. ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs ``` -------------------------------- ### Docker Compose Installation for VitoDeploy Source: https://vitodeploy.com/docs/next/getting-started/installation Sets up VitoDeploy using Docker Compose. Defines services, image, ports, environment variables, and volumes. Recommended for production with specific tag information provided. ```docker version: '3' services: vito: image: vitodeploy/vito:latest ports: - '8000:80' environment: APP_KEY: 'your-32-character-app-key' NAME: 'vito' EMAIL: 'vito@example.com' PASSWORD: 'password' APP_URL: 'http://localhost:8000' # Change this to your Vito URL volumes: - 'vito-storage:/var/www/html/storage' volumes: vito-storage: driver: local ``` -------------------------------- ### Example Laravel Deployment Script (Bash) Source: https://vitodeploy.com/docs/next/sites/application This is an example of a deployment script for a Laravel application. It demonstrates common steps like pulling the latest code, installing dependencies, running database migrations, clearing caches, and restarting services. It utilizes bash scripting and assumes the environment variables provided by VitoDeploy are available. ```bash cd $SITE_PATH php artisan down git pull origin $BRANCH composer install --no-interaction --prefer-dist --optimize-autoloader php artisan migrate --force php artisan optimize:clear php artisan optimize sudo service supervisor restart php artisan up echo "✅ Deployment completed successfully!" ``` -------------------------------- ### Docker Command Installation for VitoDeploy Source: https://vitodeploy.com/docs/next/getting-started/installation Installs VitoDeploy using a single Docker command. Requires setting environment variables for application key, admin credentials, and URL. Mounts a volume for storage. ```docker docker run -v vito_storage:/var/www/html/storage \ -e APP_KEY=your_32_character_app_key \ -e NAME=admin_name \ -e EMAIL=admin_email \ -e PASSWORD=admin_password \ -e APP_URL=http://your-vito-url \ -p 80:80 vitodeploy/vito:latest ``` -------------------------------- ### Install VitoDeploy Beta on VPS using Shell Script Source: https://vitodeploy.com/docs/2.x/getting-started/installation Installs the beta version of VitoDeploy on a Ubuntu server by setting the BETA=1 environment variable before executing the installation script. This is useful for testing pre-release features. ```bash BETA=1 bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/2.x/scripts/install.sh) ``` -------------------------------- ### Manual VPS Upgrade Steps (Bash) Source: https://vitodeploy.com/docs/next/prologue/upgrade Provides a series of bash commands for manually upgrading VitoDeploy on a VPS. This includes changing directories, stashing git changes, updating file ownership, installing PHP 8.4 with extensions, configuring PHP-FPM, installing Redis and Node.js, adjusting Nginx configuration for PHP 8.4 and increasing client body size, updating supervisor for Laravel Horizon, and pulling latest code changes. ```bash cd /home/vito/vito ``` ```bash git stash ``` ```bash sudo chown -R vito:vito /home/vito/vito ``` ```bash sudo add-apt-repository ppa:ondrej/php -y sudo apt update sudo apt install -y php8.4 php8.4-fpm php8.4-mbstring php8.4-mcrypt php8.4-gd php8.4-xml php8.4-curl php8.4-gettext php8.4-zip php8.4-bcmath php8.4-soap php8.4-redis php8.4-sqlite3 php8.4-intl sudo sed -i "s/www-data/vito/g" /etc/php/8.4/fpm/pool.d/www.conf sudo service php8.4-fpm enable sudo service php8.4-fpm start sudo apt install -y php8.4-ssh2 sudo service php8.4-fpm restart sudo sed -i "s/memory_limit = .*/memory_limit = 1G/" /etc/php/8.4/fpm/php.ini sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 1G/" /etc/php/8.4/fpm/php.ini sudo sed -i "s/post_max_size = .*/post_max_size = 1G/" /etc/php/8.4/fpm/php.ini ``` ```bash sudo apt install redis-server -y sudo service redis enable sudo service redis start ``` ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs ``` ```bash sudo sed -i "s/php8.2-fpm.sock/php8.4-fpm.sock/g" /etc/nginx/sites-available/vito ``` ```bash sudo sed -i '/location ~ \\.php$ {/a \ fastcgi_buffers 16 16k;\n fastcgi_buffer_size 32k;' /etc/nginx/sites-available/vito ``` ```bash server { ... client_max_body_size 100M; ... } ``` ```bash sudo service nginx restart ``` ```bash sudo sed -i 's/command=php \/home\/vito\/vito\/artisan queue:work --sleep=3 --backoff=0 --queue=default,ssh,ssh-long --timeout=3600 --tries=1/command=php \/home\/vito\/vito\/artisan horizon/' /etc/supervisor/conf.d/worker.conf ``` ```bash command=php /home/vito/vito/artisan horizon ``` ```bash sudo service supervisor restart ``` ```bash git fetch ``` ```bash git checkout 3.x ``` ```bash bash scripts/update.sh ``` -------------------------------- ### Install VitoDeploy on VPS using Shell Script Source: https://vitodeploy.com/docs/2.x/getting-started/installation Installs VitoDeploy on a fresh Ubuntu server using a provided shell script. This method requires root access and prompts for admin email and password. Ensure ports 80 and 443 are open. ```bash bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/2.x/scripts/install.sh) ``` -------------------------------- ### Migrate Existing VitoDeploy Configuration Source: https://vitodeploy.com/docs/next/getting-started/installation Instructions for migrating an existing VitoDeploy configuration by overwriting the storage folder and ensuring the same APP_KEY is used. A new key can be generated if needed. ```bash cp -R old_storage_folder storage ./vendor/bin/sail artisan key:generate ``` -------------------------------- ### Install VitoDeploy on VPS using Bash Script Source: https://vitodeploy.com/docs/1.x/getting-started/installation Install VitoDeploy on a Virtual Private Server (VPS) using a bash script fetched from GitHub. This method requires root privileges and specific server requirements (Ubuntu 22.04+, 1GB RAM, 1 CPU). It prompts for administrator email and password. ```bash bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/1.x/scripts/install.sh) ``` -------------------------------- ### Composer Install Command for VitoDeploy Source: https://vitodeploy.com/docs/1.x/sites/create-site This command is executed by VitoDeploy when the 'Composer Install' option is selected during the site creation process. It installs Composer dependencies with optimizations for production environments. ```shell composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev ``` -------------------------------- ### Install VitoDeploy via Docker Command Source: https://vitodeploy.com/docs/2.x/getting-started/installation Installs VitoDeploy using a single Docker command. It maps storage volumes, sets essential environment variables for application key, admin credentials, and exposes port 80. Ensure to replace placeholder values with your actual details. ```docker docker run -v vito_storage:/var/www/html/storage \ -e APP_KEY=your_32_character_app_key \ -e NAME=admin_name \ -e EMAIL=admin_email \ -e PASSWORD=admin_password \ -p 80:80 vitodeploy/vito:latest ``` -------------------------------- ### Composer Installation Command Source: https://vitodeploy.com/docs/2.x/sites/site-types This command is executed by VitoDeploy during the site creation process if the 'composer install' option is selected. It installs Composer dependencies without user interaction, preferring distributed packages, optimizing the autoloader, and excluding development dependencies. ```shell composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev ``` -------------------------------- ### Nginx VHost Configuration Example Source: https://vitodeploy.com/docs/next/sites/settings Provides an example of a Nginx virtual host configuration file used by VitoDeploy. This configuration includes sections for SSL, Laravel Octane, and custom blocks, demonstrating how to structure server directives for a website. Manual modifications might be overridden by VitoDeploy operations. ```nginx #[header] #[force-ssl] #[/force-ssl] #[laravel-octane-map] map $http_upgrade $connection_upgrade { default upgrade; '' close; } #[/laravel-octane-map] #[/header] server { #[main] #[port] listen 80; listen [::]:80; #[/port] #[core] server_name yourdomain.com ; root /home/vito/yourdomain.com/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; charset utf-8; access_log off; error_log /var/log/nginx/yourdomain.com-error.log error; location ~ /\.(?!well-known).* { deny all; } #[/core] #[laravel-octane] index index.php index.html; error_page 404 /index.php; location /index.php { try_files /not_exists @octane; } location / { try_files $uri $uri/ @octane; } location @octane { set $suffix ""; if ($uri = /index.php) { set $suffix ?$query_string; } proxy_http_version 1.1; proxy_set_header Host $http_host; proxy_set_header Scheme $scheme; proxy_set_header SERVER_PORT $server_port; proxy_set_header REMOTE_ADDR $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_pass http://127.0.0.1:8000$suffix; } #[/laravel-octane] #[redirects] #[/redirects] #[/main] } #[footer] #[/footer] ``` -------------------------------- ### Update PHP Settings (Bash) Source: https://vitodeploy.com/docs/next/prologue/upgrade Commands to update PHP 8.4 configuration settings for VitoDeploy. This includes enabling and starting PHP-FPM, installing the SSH2 extension, and adjusting memory limit, upload max file size, and post max size to 1GB. ```bash sudo add-apt-repository ppa:ondrej/php -y sudo apt update sudo apt install -y php8.4 php8.4-fpm php8.4-mbstring php8.4-mcrypt php8.4-gd php8.4-xml php8.4-curl php8.4-gettext php8.4-zip php8.4-bcmath php8.4-soap php8.4-redis php8.4-sqlite3 php8.4-intl sudo sed -i "s/www-data/vito/g" /etc/php/8.4/fpm/pool.d/www.conf sudo service php8.4-fpm enable sudo service php8.4-fpm start sudo apt install -y php8.4-ssh2 sudo service php8.4-fpm restart sudo sed -i "s/memory_limit = .*/memory_limit = 1G/" /etc/php/8.4/fpm/php.ini sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 1G/" /etc/php/8.4/fpm/php.ini sudo sed -i "s/post_max_size = .*/post_max_size = 1G/" /etc/php/8.4/fpm/php.ini ``` -------------------------------- ### Set up VitoDeploy Local Environment with Laravel Sail Source: https://vitodeploy.com/docs/1.x/getting-started/installation Initialize VitoDeploy for local development using Laravel Sail. This involves copying the Sail environment file, installing Composer dependencies, booting the Sail containers, generating an application key, creating a SQLite database, running migrations, and creating an admin user. ```bash cp .env.sail .env composer install ./vendor/bin/sail up -d ./vendor/bin/sail artisan key:generate touch storage/database.sqlite ./vendor/bin/sail artisan migrate ./vendor/bin/sail artisan user:create {name} {email} {password} ``` -------------------------------- ### Update Composer Dependencies Source: https://vitodeploy.com/docs/1.x/prologue/upgrade Installs and updates Composer dependencies for the VitoDeploy project. The `--no-dev` flag ensures that only production dependencies are installed, excluding development-only packages. ```bash composer install --no-dev ``` -------------------------------- ### Install PHP 8.2 and Extensions Source: https://vitodeploy.com/docs/1.x/prologue/upgrade Installs PHP version 8.2 along with common extensions required by VitoDeploy. This command uses apt to manage packages on Debian-based systems. ```bash sudo apt install -y php8.2 php8.2-fpm php8.2-mbstring php8.2-gd php8.2-xml php8.2-curl php8.2-gettext php8.2-zip php8.2-bcmath php8.2-soap php8.2-redis php8.2-sqlite3 php8.2-mysql ``` -------------------------------- ### Local SSH Key Generation for VitoDeploy Source: https://vitodeploy.com/docs/next/getting-started/installation Generates RSA private and public SSH keys for VitoDeploy local installation using OpenSSL. Includes commands to set permissions and extract the public key. ```bash openssl genpkey -algorithm RSA -out /PATH_TO_VITO/storage/ssh-private.pem chmod 600 /PATH_TO_VITO/storage/ssh-private.pem ssh-keygen -y -f /PATH_TO_VITO/storage/ssh-private.pem > /PATH_TO_VITO/storage/ssh-public.key ``` -------------------------------- ### Copy .env.sail to .env Source: https://vitodeploy.com/docs/next/getting-started/installation Copies the default Sail environment file to be used for local development. This file should be modified with your specific environment settings. ```bash cp .env.sail .env ``` -------------------------------- ### Navigate to Vito Project Directory (Bash) Source: https://vitodeploy.com/docs/2.x/prologue/upgrade Changes the current directory to the root of the Vito project installation. This is a prerequisite for pulling updates and switching branches. ```bash cd /home/vito/vito ``` -------------------------------- ### Install VitoDeploy via Docker Source: https://vitodeploy.com/docs/1.x/getting-started/installation Run VitoDeploy using a single Docker command. This method requires setting environment variables for application key, name, email, and password. It mounts a volume for persistent storage. ```docker docker run -v vito_storage:/var/www/html/storage \ -e APP_KEY=your_32_character_app_key \ -e NAME=your_name \ -e EMAIL=your_email \ -e PASSWORD=your_password \ -p 80:80 vitodeploy/vito:1.x ``` -------------------------------- ### Manual VPS Upgrade: Git Fetch and Checkout Source: https://vitodeploy.com/docs/prologue/upgrade Fetches the latest changes from the remote repository and checks out the '3.x' branch as part of the manual upgrade process for VitoDeploy. ```bash git fetch git checkout 3.x ``` -------------------------------- ### Stop and Disable MySQL Service Source: https://vitodeploy.com/docs/1.x/prologue/upgrade Stops the MySQL database service and disables it from starting on boot. This is performed after migrating to SQLite, as MySQL is no longer required. ```bash sudo service mysql stop sudo systemctl disable mysql ``` -------------------------------- ### Manual VPS Upgrade: Git Operations and Permissions Source: https://vitodeploy.com/docs/prologue/upgrade Steps for manually upgrading VitoDeploy on a VPS, including navigating to the project directory, stashing local changes, and ensuring correct file ownership for the 'vito' user. ```bash cd /home/vito/vito git stash sudo chown -R vito:vito /home/vito/vito ```