### Manual VPS Upgrade: Install Redis Server Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/prologue/upgrade.md Installs and starts the Redis server, which is required by VitoDeploy 3.x for caching, sessions, and queues. This ensures that Redis is available and running before proceeding with the upgrade. ```bash sudo apt install redis-server -y sudo service redis enable sudo service redis start ``` -------------------------------- ### Install Dependencies with Composer Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-2.x/getting-started/installation.mdx Installs project dependencies using Composer. Ensure you have Composer installed and the .env file is correctly configured. ```shell composer install ``` -------------------------------- ### VPS Beta Release Installation for VitoDeploy Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-2.x/getting-started/installation.mdx Installs the beta version of VitoDeploy on a VPS by setting the BETA=1 environment variable before executing the installation script. This allows testing of pre-release features on a compatible Ubuntu server. ```shell BETA=1 bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/2.x/scripts/install.sh) ``` -------------------------------- ### Install VitoDeploy on VPS using Script Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/getting-started/installation.mdx This command downloads and executes a bash script to install VitoDeploy on a fresh Ubuntu server. It requires root privileges and prompts for admin email and password. Ensure your server meets the specified requirements before running. ```sh bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/3.x/scripts/install.sh) ``` -------------------------------- ### Start Application with Laravel Sail Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-2.x/getting-started/installation.mdx Boots up the Laravel Sail environment in detached mode. This command starts the Docker containers for your application. ```shell ./vendor/bin/sail up -d ``` -------------------------------- ### Manual VPS Upgrade Steps Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-3.x/prologue/upgrade.md A collection of bash commands for manually upgrading a VitoDeploy installation on a VPS. This includes navigating to the project directory, stashing changes, fixing ownership, installing PHP 8.4 and its extensions, enabling and starting PHP-FPM, installing Redis and Node.js, adjusting Nginx configuration for PHP 8.4 and body size, updating supervisor for Laravel Horizon, and managing Git repository updates. ```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 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 sudo service supervisor restart ``` ```bash git fetch ``` ```bash git checkout 3.x ``` ```bash bash scripts/update.sh ``` -------------------------------- ### Manual VPS Upgrade: Install Node.js Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/prologue/upgrade.md Installs Node.js version 22.x, which is required for VitoDeploy v3 that uses Inertia.js. This command fetches the NodeSource setup script and installs Node.js using apt. ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs ``` -------------------------------- ### Local Development Setup with Laravel Sail Source: https://context7.com/vitodeploy/vitodeploy.com/llms.txt Configures a local development environment for VitoDeploy using Laravel Sail. Involves cloning the repository, generating SSH keys for server connections, setting up the .env file, installing dependencies, starting Docker containers, generating the application key, running migrations, and creating an admin user. ```bash # Clone the repository git clone https://github.com/vitodeploy/vito.git cd vito # Generate SSH keys for server connections openssl genpkey -algorithm RSA -out storage/ssh-private.pem chmod 600 storage/ssh-private.pem ssh-keygen -y -f storage/ssh-private.pem > storage/ssh-public.key # Set up environment cp .env.sail .env # Install dependencies composer install # Start Docker containers ./vendor/bin/sail up -d # Generate application key ./vendor/bin/sail artisan key:generate # Run migrations ./vendor/bin/sail artisan migrate # Create admin user ./vendor/bin/sail artisan user:create "Admin Name" admin@example.com password123 # Access at http://localhost:8000 ``` -------------------------------- ### Manual VPS Upgrade: Install PHP 8.4 and Extensions Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/prologue/upgrade.md Installs PHP 8.4 and necessary extensions for VitoDeploy 3.x. This includes configuring PHP-FPM to run as the 'vito' user, enabling and starting the PHP-FPM service, and adjusting memory limits and upload sizes in php.ini. ```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 ``` -------------------------------- ### Migrate VitoDeploy Configuration Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/getting-started/installation.mdx Guidance on migrating an existing VitoDeploy configuration to a new installation. This involves overwriting the current 'storage' folder with the old one and ensuring the 'APP_KEY' in the .env file matches the previous installation, or regenerating it if necessary. ```shell # Overwrite the current storage folder with the old one # Ensure the APP_KEY in .env matches the previous installation or regenerate using: # ./vendor/bin/sail artisan key:generate ``` -------------------------------- ### Set Up Local Environment with Laravel Sail Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-3.x/getting-started/installation.mdx Commands to set up the local development environment using Laravel Sail. This involves copying the Sail environment file, installing Composer dependencies, booting the application, generating the app key, creating a SQLite database, running migrations, and creating a default user. ```bash cp .env.sail .env composer install ./vendor/bin/sail up -d ./vendor/bin/sail artisan key:generate # Create storage/database.sqlite manually ./vendor/bin/sail artisan migrate ./vendor/bin/sail artisan user:create {name} {email} {password} ``` -------------------------------- ### Set Up VitoDeploy Environment with Laravel Sail Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/getting-started/installation.mdx Initializes the VitoDeploy project for local development using Laravel Sail. This involves copying the Sail environment file, installing Composer dependencies, booting the Sail services, generating the application key, and running database migrations. ```shell cp .env.sail .env composer install ./vendor/bin/sail up -d ./vendor/bin/sail artisan key:generate ./vendor/bin/sail artisan migrate ``` -------------------------------- ### VPS Installation Script for VitoDeploy Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-2.x/getting-started/installation.mdx Installs VitoDeploy on a fresh Ubuntu VPS (22.04 LTS or higher) with specified requirements. The script is executed via curl and bash, requiring root privileges. It prompts for admin email and password, which can also be provided as environment variables. ```shell bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/2.x/scripts/install.sh) ``` -------------------------------- ### Install Vito via Docker Command Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-1.x/getting-started/installation.md This command allows for a quick installation of VitoDeploy using a pre-built Docker image. It requires setting environment variables for configuration and maps a volume for persistent storage. Ensure you modify the placeholder environment variables before execution. ```sh 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: Navigate to Project Directory Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/prologue/upgrade.md Navigate to the root directory of your VitoDeploy installation on the VPS to begin the manual upgrade process. This is a prerequisite for executing subsequent manual upgrade commands. ```bash cd /home/vito/vito ``` -------------------------------- ### Laravel Deployment Script Example Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/sites/application.md A comprehensive deployment script for a Laravel application. It includes steps for pulling the latest code, installing dependencies, running migrations, clearing caches, and restarting services. ```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!" ``` -------------------------------- ### Implement Plugin Hooks (PHP) Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-3.x/plugins.md Vito Deploy allows plugins to implement methods like `install`, `uninstall`, `enable`, and `disable`. These methods are executed when the corresponding actions are performed on the plugin. The example shows a basic Plugin class structure implementing these hooks. ```php Server Providers # 2. Navigate to Servers > Create Server # 3. Select provider (AWS, DigitalOcean, Vultr, Hetzner, Linode) # 4. Fill in the form: # - Server Name: production-web-01 # - Operating System: Ubuntu 24.04 # - Region: Select from provider options # - Plan: Select from provider options # 5. Select services to install (Nginx, MySQL, PHP, Redis, etc.) # 6. Click "Create Server" # 7. Monitor real-time installation logs ``` -------------------------------- ### Creating a Database and User Source: https://context7.com/vitodeploy/vitodeploy.com/llms.txt Outlines the steps within VitoDeploy to create a new database and its associated user on a server. This involves navigating to Server > Databases > Create for the database, specifying its name and character set/collation, and then proceeding to Database Users > Create to define the username and password for the application. ```bash # 1. Navigate to Server > Databases > Create # Example database creation: # - Name: production_db # - Charset: utf8mb4 # - Collation: utf8mb4_unicode_ci # 2. Create database user: Database Users > Create # - Username: app_user # - Password: SecurePassword123 ``` -------------------------------- ### Creating a Custom Server Instance Source: https://context7.com/vitodeploy/vitodeploy.com/llms.txt Details the process of adding a custom server to VitoDeploy. This requires preparing the server by setting up SSH access with an authorized key, then using the VitoDeploy interface to specify the server name, OS, IP address, SSH port, and desired services before initiating creation. ```bash # 1. On your custom server, run as root: mkdir -p /root/.ssh && touch /root/.ssh/authorized_keys && \ echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC...' >> /root/.ssh/authorized_keys # 2. In VitoDeploy, navigate to Servers > Create Server # 3. Select "Custom" as server provider # 4. Fill in the form: # - Server Name: custom-server-01 # - Operating System: Ubuntu 24.04 # - SSH IP: 192.168.1.100 # - SSH Port: 22 # 5. Select services to install # 6. Click "Create Server" ``` -------------------------------- ### Installing Database Services on a Server Source: https://context7.com/vitodeploy/vitodeploy.com/llms.txt Provides instructions for installing database services on a server through VitoDeploy. Users navigate to Server > Services > Install and select the desired database type (MySQL, MariaDB, PostgreSQL) and version. Note that only one database type can be installed per server. ```bash # Navigate to Server > Services > Install # Select database type and version: # - MySQL: 5.7, 8.0 # - MariaDB: 10.3, 10.4, 10.6, 10.11, 11.4 # - PostgreSQL: 12, 13, 14, 15, 16, 17 # Note: Only one database type per server ``` -------------------------------- ### Copy Environment File for Sail Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-2.x/getting-started/installation.mdx Copies the example environment file '.env.sail' to '.env' to set up environment variables for Laravel Sail. This file should then be customized. ```shell cp .env.sail .env ``` -------------------------------- ### Install, Uninstall, and List Vito Plugins via CLI Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/plugins.md These bash commands demonstrate how to manage Vito plugins directly from the command line. The `plugin:install` command takes a repository URL, `plugin:uninstall` takes the plugin's vendor/name, and `plugin:list` shows currently installed plugins. Ensure the Vito CLI is accessible in your environment. ```bash # install a plugin php artisan plugin:install https://github.com/vitodeploy/laravel-octane-plugin # uninstall a plugin php artisan plugin:uninstall vitodeploy/laravel-octane-plugin # see the list of installed plugins php artisan plugin:list ``` -------------------------------- ### Docker Command Installation for VitoDeploy Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-3.x/getting-started/installation.mdx This command runs the latest VitoDeploy Docker image, mounting persistent volumes for storage and plugins, and setting essential environment variables for initial setup like admin credentials and application URL. Ensure to replace placeholder values with your actual configuration. ```sh docker run -v vito_storage:/var/www/html/storage \ -v vito_plugins:/var/www/html/app/Vito/Plugins \ -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 SSL Certificate with VitoDeploy Source: https://context7.com/vitodeploy/vitodeploy.com/llms.txt Details the process of installing SSL certificates, including free Let's Encrypt certificates with automatic renewal and custom SSL certificates. It also covers how to force HTTPS redirection. ```bash # Let's Encrypt SSL (free, automatic renewal): # Navigate to Site > SSL > Create SSL # - Type: Let's Encrypt # - Include aliases: Yes (for www.example.com) # - Email: Uses your VitoDeploy account email # - Click "Create" # Certificate auto-renews before expiration # Custom SSL certificate: # Navigate to Site > SSL > Create SSL # - Type: Custom # - Certificate: [paste certificate content] # - Private Key: [paste private key] # - Certificate Chain: [paste chain if needed] # - Click "Create" # Force HTTPS redirect: # Navigate to Site > SSL > Force SSL (after activating certificate) # All HTTP traffic redirects to HTTPS ``` -------------------------------- ### Run VitoDeploy with Docker Command Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/getting-started/installation.mdx This command starts a VitoDeploy instance using a Docker container. It mounts a volume for storage, sets essential environment variables for application key, admin credentials, and URL, and maps port 80 for access. Ensure you replace placeholder values with your actual configuration. ```sh 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 ``` -------------------------------- ### Create PHP Site with VitoDeploy Source: https://context7.com/vitodeploy/vitodeploy.com/llms.txt Instructions for creating a new PHP site, supporting frameworks like Laravel, WordPress, and Symfony, or static HTML. It covers essential configurations such as domain, PHP version, web directory, source control integration, and isolation. ```bash # 1. Navigate to Sites > Create Site # 2. Fill in the form: # - Site Type: Laravel (or PHP, WordPress, Symfony, Static HTML) # - Domain: example.com # - Aliases: www.example.com (optional, comma-separated) # - PHP Version: 8.3 # - Web Directory: /public (for Laravel, leave empty for root) # - Source Control: GitHub # - Repository: username/repository-name # - Branch: main # - Composer: Yes # - Isolation: Yes (creates dedicated system user for site) # 3. Click "Create Site" # Site will be accessible at /home/vito/example.com ``` -------------------------------- ### Use VitoDeploy API - Create Site Source: https://context7.com/vitodeploy/vitodeploy.com/llms.txt Example using curl to create a new site via the VitoDeploy API. This POST request includes site-specific details such as server ID, domain, PHP version, and source control configuration. ```bash # Example: Create new site curl -X POST "https://your-vito-instance.com/api/sites" \ -H "Authorization: Bearer vito_xxxxxxxxxxxxxxxxxxxxx" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "server_id": 1, "type": "laravel", "domain": "api-site.example.com", "aliases": ["www.api-site.example.com"], "php_version": "8.3", "web_directory": "/public", "source_control": "github", "repository": "username/repo", "branch": "main", "composer": true }' ``` -------------------------------- ### Nginx Configuration for PHP 8.4 and Body Size Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-3.x/prologue/upgrade.md These Nginx configuration snippets are for updating an existing VitoDeploy installation to use PHP 8.4 and to increase the client body size limit. The first command updates the FastCGI socket path, while the second adds buffer settings. The final example shows how to set `client_max_body_size` within the server block. ```nginx location ~ \.php$ { ... fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; ... } ``` ```nginx server { ... client_max_body_size 100M; ... } ``` -------------------------------- ### Bash Example Deployment Script Variables Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/docs/sites/application.md Demonstrates how to use environment variables exported by Vito during script execution. These variables provide context about the deployment environment, such as site path, domain, and branch. ```shell echo "Deploying $DOMAIN to $SITE_PATH" ``` -------------------------------- ### Install PHP 8.2 on Vito Instance Source: https://github.com/vitodeploy/vitodeploy.com/blob/main/versioned_docs/version-1.x/prologue/upgrade.md Installs PHP version 8.2 and necessary extensions on the Vito instance using apt. This is a prerequisite for upgrading to VitoDeploy 1.x. ```shell 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 ```