### Create and Navigate Project Directory (Console) Source: https://docs.vultr.com/md/how-to-deploy-dev-environments-with-dstack-on-vultr This command creates a new directory named 'quickstart' and then navigates into it. This is typically the first step in setting up a new project or environment. ```bash mkdir quickstart && cd quickstart ``` -------------------------------- ### Build and Start the Application Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 These commands are used to build the project using Webpack and then start the Node.js server. The build process bundles the React application, and the server command runs the main Express server file. ```bash $ npx webpack $ node src/index.js ``` -------------------------------- ### Start Mattermost Server Source: https://docs.vultr.com/md/how-to-deploy-mattermost---an-opensource-slack-alternative Initiates the Mattermost service using `systemctl`. This command applies the configuration changes and starts the application. A waiting period is recommended for database synchronization. ```bash sudo systemctl start mattermost ``` -------------------------------- ### Enable and Start MongoDB Service on Ubuntu Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 Enables the MongoDB service to start automatically on boot and starts the service immediately. This ensures that MongoDB is running and accessible for your application. ```bash $ sudo systemctl enable --now mongod ``` -------------------------------- ### Create New Strapi Project with Quickstart Source: https://docs.vultr.com/md/how-to-deploy-strapi-on-a-kubernetes-cluster Initializes a new Strapi project named 'strapi-project' using the latest version of `create-strapi-app`. The `--quickstart` flag enables a rapid setup with default configurations, and `--js` specifies JavaScript as the project language. This command installs necessary dependencies and sets up the project structure. ```Bash npx create-strapi-app@latest strapi-project --quickstart --js ``` -------------------------------- ### Initialize NPM Project and Install Dependencies Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 This snippet demonstrates the commands to initialize a new NPM project and install all necessary project dependencies, including Express, MongoDB driver, React, Webpack, Babel, and Dotenv. ```bash $ npm init -y $ npm i express mongodb react react-dom webpack webpack-cli html-webpack-plugin @babel/core @babel/preset-env @babel/preset-react babel-loader dotenv ``` -------------------------------- ### List Available Ruby Versions Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Displays a list of all Ruby versions that can be installed using rbenv. This command is useful for determining which version of Ruby to install. ```bash rbenv install -l ``` -------------------------------- ### cloud-config: Install MySQL Source: https://docs.vultr.com/md/how-to-deploy-a-vultr-server-with-cloudinit-userdata This cloud-config example demonstrates how to install the MySQL server package on an instance. It's a basic example that can be expanded for more complex configurations. ```cloud-config #cloud-config packages: - mysql-server ``` -------------------------------- ### Manage Cassandra Service Status and Startup Source: https://docs.vultr.com/md/how-to-install-apache-cassandra-on-rocky-linux-8 These commands are used to start, enable, and check the status of the Apache Cassandra service. Starting the service makes it operational, enabling it ensures it runs on system reboot, and checking the status confirms its health. ```shell sudo service cassandra start sudo systemctl enable cassandra sudo service cassandra status ``` -------------------------------- ### Start Passbolt Interactive Configuration Source: https://docs.vultr.com/md/how-to-deploy-passbolt-an-opensource-password-management-tool Initiates the interactive configuration process for Passbolt. This command handles dependency downloads, firewall and database setup, Nginx configuration, and TLS certificate generation. ```console $ sudo /usr/local/bin/passbolt-configure ``` -------------------------------- ### Install and Manage MariaDB Server on OpenBSD Source: https://docs.vultr.com/md/how-to-install-mariadb-on-openbsd-7 Commands to install the MariaDB server package, enable it to start on boot, start the daemon, and check its status. ```bash # pkg_add mariadb-server # rcctl enable mysqld # rcctl start mysqld # rcctl check mysqld # mysql_install_db ``` -------------------------------- ### Start QuestDB Server Source: https://docs.vultr.com/md/how-to-securely-deploy-questdb-on-a-vultr-cloud-server This command starts the QuestDB server. Ensure you have QuestDB installed and the executable is in your PATH or navigate to the QuestDB directory. ```bash ./bin/questdb.sh start ``` -------------------------------- ### Install PostgreSQL Server Source: https://docs.vultr.com/md/install-mywebsql-on-ubuntu-20-04 Installs PostgreSQL 12, enables it to start on boot, starts the service, and secures it by changing the default password. This section is an alternative to setting up MySQL. ```bash sudo apt install postgresql-12 -y sudo systemctl enable postgresql sudo systemctl start postgresql sudo passwd postgres su - postgres ``` -------------------------------- ### Verify Rails Installation Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Checks the installed version of the Rails framework. This confirms that Rails has been successfully installed and is ready for use. ```bash rails -v Rails 6.x.x.x ``` -------------------------------- ### Example Application Configuration and Access Source: https://docs.vultr.com/md/vultr-marketplace-tips-for-readme-and-app-instructions This snippet shows the expected output format for an example application's instructions. It includes placeholders for the server IP address, root password, web server credentials, and MySQL root password. It also provides links to further documentation. ```text # Example Application Your application is ready! * Your server's IP address is: {{ip}}. * The root password is: `{{root_password}}`. Connect to your web server at [**https://{{ip}}/**](https://{{ip}}/). * Your webserver username is: **demo**. * Your webserver password is: `{{web_pass}}`. The MySQL root password is: `{{db_pass}}`. Learn more in the [Vultr Marketplace Application Instructions](https://docs.vultr.com/vultr-marketplace) guide. ``` -------------------------------- ### Verify Yarn Installation Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Confirms that Yarn has been installed correctly by displaying its version number. This is a standard verification step after installing any package manager. ```bash yarn -v 1.2x.xx ``` -------------------------------- ### Make Startup Script Executable and Run Server Source: https://docs.vultr.com/md/install-paper-on-ubuntu-20-04 Makes the `start.sh` script executable using `chmod +x` and then runs the server by executing the script. The first launch prompts for EULA acceptance, and the script will loop until the EULA is accepted by editing `eula.txt`. ```bash chmod +x start.sh ./start.sh ``` -------------------------------- ### Verify Node.js Installation Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Checks the installed version of Node.js to confirm successful installation. This command is typically used after installing Node.js to ensure the runtime is available and correctly configured. ```bash node -v v16.xx.x ``` -------------------------------- ### Install Rails Gem Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs the Rails web framework using RubyGems. This command fetches and installs the latest stable version of Rails and its dependencies. ```bash gem install rails ``` -------------------------------- ### Create Sample Files and Directories Source: https://docs.vultr.com/md/how-to-set-up-automatic-backups-with-veeam-and-vultr-block-storage This set of console commands demonstrates the creation of a sample project directory and two text files within it, which can then be used for a Veeam backup demonstration. ```console mkdir ~/project cd ~/project touch test1.txt touch test2.txt ``` -------------------------------- ### Install Apache Web Server on Ubuntu Source: https://docs.vultr.com/md/install-linux-apache-mysql-and-php-lamp-on-ubuntu-20-04-lts Installs the Apache HTTP web server, which is responsible for serving web content. This command ensures Apache is installed with all necessary dependencies. ```bash sudo apt install -y apache2 ``` -------------------------------- ### Bash Commands for Environment Setup and Package Installation Source: https://docs.vultr.com/md/how-to-use-vultr--s-miniconda-marketplace-app These bash commands are used to create and activate a Conda environment, and install the scikit-learn library. This setup is a prerequisite for running the Python KNN classification example. It involves environment management and package installation. ```bash # conda create --name knn_example # conda activate knn_example ``` ```bash # conda install scikit-learn ``` -------------------------------- ### Create example.com DNS Zone File Source: https://docs.vultr.com/md/how-to-create-a-nat-router-for-vultr-vpc-2-0 This command opens a new file named 'example.com.zone' in the '/etc/bind/zones/' directory using the Nano text editor. This file will contain the DNS records for the 'example.com' domain. ```console $ sudo nano example.com.zone ``` -------------------------------- ### Launch Plesk Web Installer Source: https://docs.vultr.com/md/how-to-install-plesk-on-ubuntu-20-04 Executes the downloaded Plesk installer script with the `--web-interface` argument to start the Plesk installation via a web browser. This command initiates the graphical setup process. ```bash $ sudo ./plesk-installer --web-interface ``` -------------------------------- ### Initialize Go Module Source: https://docs.vultr.com/md/how-to-install-go-on-debian-12 Initializes a new Go module named 'example.com/hello' within the current directory. This creates a 'go.mod' file to manage project dependencies. ```bash go mod init example.com/hello ``` -------------------------------- ### Per-Instance Provisioning Script Example (Bash) Source: https://docs.vultr.com/md/platform/marketplace/build-an-example-app A bash script that runs once when a new server instance is deployed from a snapshot. It logs deployment times, captures marketplace variables (like database and web passwords), creates a database, adds a user, and sets up Nginx authentication. ```bash #!/bin/bash # Log start time date +'%Y-%m-%d %H:%M:%S' >> /var/log/per-instance.log # Capture marketplace variables using curl db_pass=$(curl http:///v1/internal/app-db_pass) web_pass=$(curl http:///v1/internal/app-web_pass) # Create database and user mysql -u root -e "CREATE DATABASE marketplace_db;" mysql -u root -e "CREATE USER 'example_user'@'localhost' IDENTIFIED BY '$db_pass';" mysql -u root -e "GRANT ALL PRIVILEGES ON marketplace_db.* TO 'example_user'@'localhost';" # Create Nginx password for example_user htpasswd -b -c /etc/nginx/htpasswd.users example_user $web_pass # Log end time date +'%Y-%m-%d %H:%M:%S' >> /var/log/per-instance.log ``` -------------------------------- ### Remove PrestaShop Installation Directory Source: https://docs.vultr.com/md/one-click-prestashop Removes the installation directory from the PrestaShop server to enhance security after the initial setup. This prevents unauthorized access to the installation scripts. Requires SSH access to the server. ```shell # rm -rf /var/www/html/install/ ``` -------------------------------- ### Install a Specific Node.js Version Source: https://docs.vultr.com/md/how-to-install-node-js-and-npm-on-rocky-linux-9 This command installs a particular version of Node.js. For example, 'nvm install 19' will download and install Node.js version 19. NVM handles the download and setup process. ```console nvm install 19 ``` -------------------------------- ### Start Pritunl Service Source: https://docs.vultr.com/md/how-to-install-and-setup-pritunl-vpn-server-on-ubuntu-2404 Starts the Pritunl system service immediately. This command initiates the Pritunl daemon, allowing it to begin its operations, such as managing VPN connections and configurations. ```bash sudo systemctl start pritunl ``` -------------------------------- ### Run iRedMail Installation Script Source: https://docs.vultr.com/md/how-to-install-iredmail-on-ubuntu-24-04 Executes the main iRedMail installation script using `bash`. This command initiates the interactive setup wizard that guides the user through the configuration process. ```bash sudo bash iRedMail.sh ``` -------------------------------- ### MySQL: Create a New Sample Database Source: https://docs.vultr.com/md/how-to-install-mysql-on-ubuntu-2204 This SQL command creates a new database, for example, named `example_vultr`. This is a practical step for setting up a new project or testing environment. ```sql mysql> CREATE DATABASE example_vultr; ``` -------------------------------- ### Open Cypress and Initialize Configuration Source: https://docs.vultr.com/md/how-to-automate-cicd-pipelines-for-cypress-testing-with-github-actions Launches the Cypress Test Runner and initializes the project's configuration files and directory structure. This command is typically run after Cypress has been installed. ```bash npx cypress open ``` -------------------------------- ### Install MongoDB Community Edition on Ubuntu Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 Installs the MongoDB Community Edition on Ubuntu using the APT package manager. This command fetches and installs the necessary MongoDB packages. ```bash $ sudo apt install -y mongodb-org ``` -------------------------------- ### Start and Stop QuestDB Server Source: https://docs.vultr.com/md/how-to-securely-deploy-questdb-on-a-vultr-cloud-server Provides commands to start and stop the QuestDB server instance, typically used after modifying configuration files. It navigates to the QuestDB installation directory to execute the scripts. ```bash cd questdb-6.6.1-rt-linux-amd64 ./bin/questdb.sh stop ./bin/questdb.sh start ``` -------------------------------- ### Install rbenv Ruby Version Manager Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs rbenv, a tool for managing multiple Ruby versions on a single system. The provided command downloads and executes an installer script from GitHub. ```bash curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash ``` -------------------------------- ### MySQL Commands for Database and User Setup Source: https://docs.vultr.com/md/how-to-install-nginx-mysql-php-femp-stack-on-freebsd-14-0 This snippet demonstrates the SQL commands necessary to set up a sample database, create a user, grant privileges, and create a table within MySQL. It is essential for preparing the database backend for a web application. ```sql CREATE DATABASE example_db; SHOW DATABASES; use example_db; CREATE USER 'test_user'@'localhost' IDENTIFIED BY 'Strong)P@ssword123'; CREATE TABLE greetings ( id INT AUTO_INCREMENT PRIMARY KEY, message VARCHAR(255) ); INSERT INTO greetings (message) VALUES ('Hello World. Greetings from Vultr'); \q ``` -------------------------------- ### Start JupyterLab Server (Bash) Source: https://docs.vultr.com/md/ai-generated-images-with-openjourney-and-vultr-cloud-gpu Starts the JupyterLab server in the background, listening on all network interfaces (0.0.0.0) on the default port 8888. ```bash jupyter lab --ip 0.0.0.0 & ``` -------------------------------- ### Connect to Database with Example User (SQL) Source: https://docs.vultr.com/md/how-to-build-an-example-vultr-marketplace-application This command-line snippet demonstrates how to log into the MySQL database as 'example_user'. It requires the database password, which is set by the per-instance provisioning script and can be found in server information or a text file. ```bash mysql -u example_user -p ``` -------------------------------- ### Start and Enable OpenVPN Server Source: https://docs.vultr.com/md/how-to-create-an-openvpn-server-on-ubuntu-20-04 These commands enable the OpenVPN server service to start automatically on boot and then start the service immediately. ```bash sudo systemctl enable openvpn@server sudo systemctl start openvpn@server ``` -------------------------------- ### Create Sample Index HTML - Console Source: https://docs.vultr.com/md/how-to-install-caddy-webserver-on-rocky-linux-9 This command opens a text editor (nano) to create a sample index.html file for the virtual host. This file will be served to visitors. ```console $ sudo nano /var/www/app.example.com/html/index.html ``` -------------------------------- ### Enable and Start WireGuard Client (Bash) Source: https://docs.vultr.com/md/how-to-install-wireguard-vpn-server-on-rocky-linux Commands to enable and start the WireGuard client interface (`tun0`) using systemd, similar to the server setup. ```bash sudo systemctl enable wg-quick@tun0 systemctl start wg-quick@tun0 systemctl status wg-quick@tun0 ``` -------------------------------- ### Start MongoDB Service Source: https://docs.vultr.com/md/how-to-install-and-setup-pritunl-vpn-server-on-ubuntu-2404 Initiates the MongoDB service. This command starts the MongoDB daemon, making the database available for Pritunl to connect to and use for storing its operational data. ```bash sudo systemctl start mongod ``` -------------------------------- ### Install Build-Essential Package (Ubuntu) Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs the build-essential package, which includes compilers and development tools necessary for compiling software from source. This is a common prerequisite for many software installations on Debian-based systems like Ubuntu. ```bash sudo apt-get install build-essential ``` -------------------------------- ### Install Bundler Gem Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs Bundler, a gem for managing Ruby application dependencies. Bundler ensures that applications run with the exact versions of gems specified in the Gemfile. ```bash gem install bundler ``` -------------------------------- ### ImgProxy environment configuration example Source: https://docs.vultr.com/md/how-to-deploy-imgproxy-process-resize-convert-images-on-the-fly This is an example of an ImgProxy environment configuration file. It sets parameters like the binding address and port, read/write timeouts, worker count, queue size, image quality, preferred formats, log level, and watermark settings. These configurations allow customization of ImgProxy's behavior. ```ini IMGPROXY_BIND=:8080 IMGPROXY_NETWORK=tcp IMGPROXY_READ_TIMEOUT=10 IMGPROXY_WRITE_TIMEOUT=10 IMGPROXY_WORKERS=2 IMGPROXY_REQUESTS_QUEUE_SIZE=0 IMGPROXY_QUALITY=100 IMGPROXY_PREFERRED_FORMATS=webp,jpeg,png,gif,avif IMGPROXY_LOG_FORMAT="pretty" IMGPROXY_LOG_LEVEL="INFO" IMGPROXY_WATERMARK_URL=https://www.vultr.com/_images/og/default.png IMGPROXY_WATERMARK_OPACITY=1 ``` -------------------------------- ### Install Node.js LTS Version (Ubuntu) Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs the latest Long Term Support (LTS) version of Node.js, which is a JavaScript runtime essential for Rails' Asset Pipeline. It first sets up the NodeSource repository and then installs the Node.js package. ```bash curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install nodejs ``` -------------------------------- ### Install Specific Ruby Version Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs a specific version of Ruby (e.g., 3.0.2) using rbenv. This is a crucial step for ensuring compatibility, as Rails requires Ruby 2.5.0 or greater. ```bash rbenv install 3.0.2 -v ``` -------------------------------- ### Initialize and Configure TightVNC Server Source: https://docs.vultr.com/md/install-gui-environment-for-ubuntu Initializes the TightVNC server for a specific user, setting up the VNC password and generating initial configuration files. It involves starting the server, setting a password (truncated to 8 characters), and modifying the `xstartup` script to launch XFCE. The commands are executed as a regular user, not root. ```bash $ su - example_user $ vncserver $ vncserver -kill :1 $ cp ~/.vnc/xstartup ~/.vnc/xstartup.bak $ nano ~/.vnc/xstartup # Add the following line to the end of ~/.vnc/xstartup: startxfce4 & ``` -------------------------------- ### Create win.example.com DNS Zone File Source: https://docs.vultr.com/md/how-to-create-a-nat-router-for-vultr-vpc-2-0 This command opens a new file named 'win.example.com.zone' in the '/etc/bind/zones/' directory using the Nano text editor. This file is intended to contain the DNS records for the 'win.example.com' subdomain. ```console $ sudo nano win.example.com.zone ``` -------------------------------- ### Verify rbenv Installation Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Runs a diagnostic script provided by rbenv to check if it's installed correctly and accessible in the system's PATH. This helps confirm that rbenv is set up for use. ```bash curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor | bash ``` -------------------------------- ### Run Initial Cohere Toolkit Setup Source: https://docs.vultr.com/md/how-to-install-cohere-toolkit-on-ubuntu-24-04 Executes the 'first-run' target of the Makefile to automate the initial setup of the Cohere Toolkit. This may require sudo privileges. ```console sudo make first-run ``` -------------------------------- ### Install Git and Curl (Ubuntu) Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs Git for version control and curl for transferring data with URLs. These are fundamental tools for downloading software, managing code repositories, and scripting tasks. ```bash sudo apt-get install git curl ``` -------------------------------- ### Create and Navigate to Project Directory (Shell) Source: https://docs.vultr.com/md/how-to-install-gradle-on-ubuntu-24-04 These commands create a new directory for the Gradle project and then navigate into it. This is the initial setup step for any new project. ```shell mkdir sample_project cd sample_project ``` -------------------------------- ### Install Node.js on Ubuntu Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 Installs the Node.js runtime environment on Ubuntu using the APT package manager. This command ensures that Node.js and its associated package manager (npm) are available on the system. ```bash $ sudo apt install -y nodejs ``` -------------------------------- ### Example Vultr Marketplace App Instructions Source: https://docs.vultr.com/md/platform/marketplace/populate-application-page An example of Markdown for Vultr Marketplace App Instructions, utilizing placeholders for variables like IP address and passwords. It includes a direct link for the user and highlights sensitive information. ```markdown # Example Application Your application is ready! * Your server's IP address is: {{ip}}. * The root password is: `{{root_password}}`. Connect to your web server at [**https://{{ip}}/**](https://{{ip}}/). * Your webserver username is: **demo**. * Your webserver password is: `{{web_pass}}`. The MySQL root password is: `{{db_pass}}`. ``` -------------------------------- ### Install Yarn Package Manager (Ubuntu) Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs Yarn, a JavaScript package manager often used alongside Node.js for managing project dependencies. This process involves adding the Yarn repository GPG key and source list before installing the package. ```bash curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn ``` -------------------------------- ### Access Pritunl Web Console URL Source: https://docs.vultr.com/md/how-to-install-and-setup-pritunl-vpn-server-on-ubuntu-2404 This snippet provides the base URL to access the Pritunl web console. It's the entry point for all subsequent configuration steps. No specific dependencies or input parameters are required, as it's a direct URL to a web service. ```text https://pritunlvpn.example.com ``` -------------------------------- ### Add NodeSource Repository for Node.js Installation Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 Adds the NodeSource repository for Node.js version 14.x to the APT sources list on Ubuntu. This allows `apt` to find and install specific Node.js versions. ```bash $ echo 'deb https://deb.nodesource.com/node_14.x focal main' | sudo tee -a /etc/apt/sources.list ``` -------------------------------- ### Install Ruby Development Dependencies (Ubuntu) Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Installs essential development libraries for Ruby, including SSL, zlib, and SQLite3 support. These are often required for Ruby gems that interact with external libraries or databases. ```bash sudo apt-get install libssl-dev zlib1g-dev sqlite3 libsqlite3-dev ``` -------------------------------- ### Create New Rails Application Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Generates a new Ruby on Rails project named 'hello-world' in the user's home directory. It then navigates into the newly created project directory. ```bash cd ~ rails new hello-world cd hello-world ``` -------------------------------- ### Building App Image from a Snapshot Source: https://docs.vultr.com/md/vultr-marketplace Guide on preparing a server and building a marketplace app image from a snapshot, including optimization and cleanup steps. ```APIDOC ## Building App Image from a Snapshot ### Description This method involves pre-installing your application on a server, configuring it, and then creating a snapshot of the disk image. When customers deploy your app, they deploy this snapshot, and cloud-init runs post-deployment scripts. ### Best Practices for Snapshot Building * **Optimize Server Size**: Design your app for the smallest local storage plan that fits your instance. Consider the `marketplace-2c-2gb` plan (2 vCPUs, 2 GB memory, 8 GB local storage) available via the Vultr API. * **Clean Up**: Remove old logs, temporary files, and uninstall unneeded software. * **Wipe Free Space**: Overwrite free disk sectors with zeros to allow for better compression and faster customer deployments. ### API Example: Deploying a Marketplace Instance ```bash curl "https://api.vultr.com/v2/instances" \ -X POST \ -H "Authorization: Bearer ${VULTR_API_KEY}" \ -H "Content-Type: application/json" \ --data '{ "region": "ewr", "plan": "marketplace-2c-2gb", "os_id": 1743, "label": "my-marketplace-server", "hostname": "marketplace-node" }' ``` ### Server Optimization and Cleanup Steps #### Verify /tmp ```bash # mkdir /tmp # chmod 1777 /tmp ``` #### Update the Server * **Yum-based distributions**: ```bash # yum update -y # yum clean all ``` * **Apt-based distributions**: ```bash # apt-get -y update # apt-get -y upgrade # apt-get -y autoremove # apt-get -y autoclean ``` #### Clean Temporary Files ```bash # rm -rf /tmp/* # rm -rf /var/tmp/* ``` #### Clean SSH Keys ```bash # rm -f /root/.ssh/authorized_keys /etc/ssh/*key* # touch /etc/ssh/revoked_keys # chmod 600 /etc/ssh/revoked_keys ``` #### Clean the Logs ```bash # find /var/log -mtime -1 -type f -exec truncate -s 0 {} \; # rm -rf /var/log/*.gz # rm -rf /var/log/*.[0-9] # rm -rf /var/log/*-???????? # echo "" >/var/log/auth.log ``` #### Clean old cloud-init information ```bash # rm -rf /var/lib/cloud/instances/* ``` #### Clean the session history ```bash # history -c # cat /dev/null > /root/.bash_history # unset HISTFILE ``` #### Update mlocate ```bash # /usr/bin/updatedb ``` #### Wipe Random Seed ```bash # rm -f /var/lib/systemd/random-seed ``` #### Wipe Machine ID ```bash # rm -f /etc/machine-id # touch /etc/machine-id ``` #### Clear login History ```bash # cat /dev/null > /var/log/lastlog # cat /dev/null > /var/log/wtmp ``` #### Wipe Free Space ```bash # dd if=/dev/zero of=/zerofile # sync # rm /zerofile # sync ``` ### Example Shell Script For convenience, these steps are also available as an [example shell script in our GitHub repository](https://github.com/vultr/vultr-marketplace/blob/main/cleanup-example/cleanup-example.sh). ``` -------------------------------- ### Create Go Project Directory Source: https://docs.vultr.com/md/how-to-install-go-on-debian-12 Creates a new directory named 'go-sample' to house your Go project. This is the first step in organizing your Go application files. ```bash mkdir go-sample ``` -------------------------------- ### Confirm Ruby Installation Source: https://docs.vultr.com/md/installing-ruby-on-rails-on-ubuntu-20-04 Verifies the currently active Ruby version. This command should show the version that was just set as the global default. ```bash ruby -v ruby 3.0.2pxxx ``` -------------------------------- ### Clone Vultr Marketplace Repository Source: https://docs.vultr.com/md/platform/marketplace/build-an-example-app Clones the Vultr Marketplace GitHub repository to your local machine. This is the first step to access the necessary files and examples for building applications. ```console $ git clone https://github.com/vultr/vultr-marketplace.git ``` -------------------------------- ### MySQL: Create Sample Database Source: https://docs.vultr.com/md/how-to-install-apache-mysql-php-famp-stack-on-freebsd-14-0 This SQL command creates a new database named 'exampledb'. This database will be used to store application data. ```sql mysql> create database exampledb; ``` -------------------------------- ### Activate DStack Server Source: https://docs.vultr.com/md/how-to-deploy-dev-environments-with-dstack-on-vultr Starts the DStack server process. This command initiates the DStack service, which then outputs the URL and a token for CLI configuration. ```bash dstack server ``` -------------------------------- ### Configure Webmin Setup Script Source: https://docs.vultr.com/md/how-to-install-virtualmin-on-freebsd-14-0 Executes the Webmin setup script to configure directories, paths, ports, administrator credentials, and SSL for the Webmin web interface. This script guides the user through interactive prompts for configuration. It requires sudo privileges. ```bash sudo sh /usr/local/lib/webmin/setup.sh ``` -------------------------------- ### Run Webmin Setup Script Source: https://docs.vultr.com/md/how-to-install-webmin-on-freebsd-14-0 Initiates the Webmin setup script, which configures essential settings such as directories for configurations and logs, the listening port, and user credentials for accessing the Webmin interface. SSL can also be enabled during this step. ```console sudo /usr/local/lib/webmin/setup.sh ``` -------------------------------- ### Create Sample PHP Info File Source: https://docs.vultr.com/md/how-to-install-apache-mysql-php-lamp-stack-on-ubuntu-2204 This command opens a new file named 'info.php' in the 'nano' editor to create a sample PHP script. This script will be used to test the PHP-FPM integration with Apache. ```bash sudo nano /var/www/html/app.example.com/info.php ``` -------------------------------- ### Install and Enable Icecast Service (Bash) Source: https://docs.vultr.com/md/install-icecast-on-ubuntu-20-04 Installs the Icecast streaming server package and configures it to start automatically on boot. It also starts the Icecast service immediately after installation. ```bash $ sudo apt install icecast2 $ sudo systemctl enable icecast2 $ sudo systemctl start icecast2 ``` -------------------------------- ### Sample Index HTML Content Source: https://docs.vultr.com/md/how-to-install-apache-web-server-on-ubuntu-24-04 This is a basic HTML file that displays a 'Greetings from Vultr' message. It serves as a placeholder to confirm that the web server is correctly configured and serving content. ```html Apache Web Server

Greetings from Vultr

``` -------------------------------- ### Install PostgreSQL Server on Ubuntu Source: https://docs.vultr.com/md/how-to-install-and-use-pghero-on-ubuntu-20-04 Installs PostgreSQL version 12, enables it to start on system startup, and then starts the PostgreSQL service. ```bash sudo apt -y install postgresql-12 sudo systemctl enable postgresql sudo systemctl start postgresql ``` -------------------------------- ### Example Vultr Marketplace Readme Source: https://docs.vultr.com/md/platform/marketplace/populate-application-page A sample Markdown file for a Vultr Marketplace app's Readme section. It includes a main heading, a subheading, bullet points for features, an image, and a link to more information. ```markdown ## About MyApp MyApp is a groundbreaking app that does something special. As soon as you click deploy, the Vultr cloud orchestration takes over and spins up your instance in your desired data center. ### Point-and-Click Management MyApp has a user-friendly management interface where you can manage: * Email accounts * Databases * Security settings * Passwords Here's an example screenshot: ![Example screenshot](https://docs.vultr.com/public/doc-assets/917/d2441f17b837b7d0.png) [Learn more about MyApp](https://www.example.com/about/myapp). ``` -------------------------------- ### MySQL: Select All Customers Where First Name Starts with 'J' Source: https://docs.vultr.com/md/how-to-use-mysql-regular-expressions This example uses the MySQL REGEXP function with the caret ('^') anchor to select records where the 'first_name' column begins with the letter 'J'. This is useful for filtering data based on specific starting patterns. ```sql SELECT customer_id, first_name, last_name FROM customers WHERE first_name REGEXP '^J'; ``` -------------------------------- ### Start Next.js Development Server Source: https://docs.vultr.com/md/how-to-automate-cicd-pipelines-for-cypress-testing-with-github-actions Starts the Next.js development server, which enables hot-reloading and other development-specific features. This command compiles and serves the application locally, typically on `http://localhost:3000`. ```console npm run dev ``` -------------------------------- ### Cal.com Prisma Database Initialization Source: https://docs.vultr.com/md/how-to-install-self-hosted-cal-on-ubuntu-20-04 Commands to deploy the Prisma database schema and start Prisma Studio, which is used for initial data seeding, such as creating the first user account. ```bash # npx prisma migrate deploy # npx prisma studio # systemctl start cal ``` -------------------------------- ### Basic Tmux Session Creation and Socket Directory Setup Source: https://docs.vultr.com/md/how-to-install-and-use-tmux Starts a tmux session, creating a socket directory, and checks its initial permissions. This is a prerequisite for sharing sessions. ```bash $ tmux $ ls -hdl /tmp/tmux-1001 ``` -------------------------------- ### Create ftp.example.com DNS Zone File Source: https://docs.vultr.com/md/how-to-create-a-nat-router-for-vultr-vpc-2-0 This command opens a new file named 'ftp.example.com.zone' in the '/etc/bind/zones/' directory using the Nano text editor. This file will contain the DNS records for the 'ftp.example.com' subdomain. ```console $ sudo nano ftp.example.com.zone ``` -------------------------------- ### Install Nginx for Reverse Proxy Source: https://docs.vultr.com/md/how-to-install-rabbitmq-on-ubuntu-2204 Installs Nginx on Ubuntu, enables it to start on boot, and starts the service. This is a prerequisite for setting up the reverse proxy. ```bash sudo apt install nginx -y sudo systemctl enable nginx sudo systemctl start nginx ``` -------------------------------- ### Command Line Operations for Let's Encrypt Certificate Setup Source: https://docs.vultr.com/md/secure-a-golang-web-server-with-a-selfsigned-or-lets-encrypt-ssl-certificate This section outlines the command-line operations required to manage the Go program for Let's Encrypt certificate integration. It includes removing old files, creating new ones, fetching dependencies, building the executable, and setting necessary permissions to run on privileged ports. ```bash $ rm https.go $ nano https.go $ go get "golang.org/x/crypto/acme/autocert" $ go build https.go $ sudo cp https /usr/local/bin/https $ sudo setcap CAP_NET_BIND_SERVICE+ep /usr/local/bin/https $ https ``` -------------------------------- ### Install Cockpit on Ubuntu 24.04 Source: https://docs.vultr.com/md/how-to-install-cockpit-on-ubuntu-24-04 Commands to update the package index, install Cockpit, enable its service to start at boot, and start the service. ```bash sudo apt update sudo apt install cockpit -y sudo systemctl enable cockpit.socket sudo systemctl start cockpit sudo systemctl status cockpit ``` -------------------------------- ### PHP MySQL Connection and Query Example Source: https://docs.vultr.com/md/how-to-use-vultr-s-lamp-marketplace-application This PHP script demonstrates connecting to a MySQL database, executing a query to fetch a user's name, and displaying it. It includes error handling for the database connection and query execution. Ensure database credentials are correct. ```php connect_error) { die("Database connection failed: " . $conn->connect_error); } // Run a query $sql = "SELECT name FROM users"; $result = $conn->query($sql); // Display result if ($result && $row = $result->fetch_assoc()) { echo "

" . htmlspecialchars($row["name"]) . "

"; } else { echo "No matching record found in the database or query error."; } // Close connection $conn->close(); ?> ``` -------------------------------- ### Setup SonarQube Systemd Service Source: https://docs.vultr.com/md/install-sonarqube-on-ubuntu-20-04-lts Creates a systemd service file to manage the SonarQube application, enabling it to start automatically at system boot and be controlled via systemctl commands. This service configuration specifies start and stop commands, user/group permissions, and restart policies. ```systemd [Unit] Description=SonarQube service After=syslog.target network.target [Service] Type=forking ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop User=sonar Group=sonar Restart=always LimitNOFILE=65536 LimitNPROC=4096 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Install Pritunl Source: https://docs.vultr.com/md/how-to-install-and-setup-pritunl-vpn-server-on-ubuntu-2404 Installs the Pritunl VPN server software. This command fetches the Pritunl package from its configured repository and installs it along with any necessary dependencies that were not previously installed. ```bash sudo apt install pritunl -y ``` -------------------------------- ### Per-Boot Provisioning Script Example (Bash) Source: https://docs.vultr.com/md/platform/marketplace/build-an-example-app A bash script that executes on every boot of a server instance. It logs the date and time of each boot, providing a record of server restarts. This script can be modified for custom boot-time actions. ```bash #!/bin/bash # Log the boot date and time date +'%Y-%m-%d %H:%M:%S' >> /var/log/per-boot.log ``` -------------------------------- ### Cal.com Systemd Service Setup Source: https://docs.vultr.com/md/how-to-install-self-hosted-cal-on-ubuntu-20-04 A systemd service file to manage the Cal.com application, ensuring it runs as a service, restarts on failure, and starts automatically on system boot. ```ini [Unit] Description=Self Hosted Cal.com After=network.target [Service] Type=simple User=example ExecStart=yarn start WorkingDirectory=/opt/cal.com/apps/web Restart=on-failure [Install] WantedBy=multi-user.target ``` -------------------------------- ### Install and Manage Apache Service on Ubuntu Source: https://docs.vultr.com/md/how-to-install-apache-mysql-php-lamp-stack-on-ubuntu-2004 These commands cover the essential steps for installing the Apache web server on Ubuntu 20.04, starting the service, enabling it for automatic startup, and checking its status. It also includes opening port 80 for HTTP traffic. ```bash sudo apt update sudo apt install apache2 -y sudo systemctl start apache2 sudo systemctl enable apache2 sudo systemctl status apache2 sudo ufw allow 80/tcp ``` -------------------------------- ### Install MySQL Server on Ubuntu Source: https://docs.vultr.com/md/how-to-install-wordpress-on-ubuntu-24-04 Installs the MySQL server package, checks the installed version, starts the MySQL service, enables it to start on boot, and verifies its running status. It also includes the command to run the secure installation script. ```bash sudo apt install mysql-server -y mysql --version sudo systemctl start mysql sudo systemctl enable mysql sudo systemctl status mysql sudo mysql_secure_installation ``` -------------------------------- ### Secure MariaDB Installation Source: https://docs.vultr.com/md/how-to-install-the-traccar-gps-tracking-system-on-ubuntu-20-04-lts This command initiates the MariaDB secure installation wizard, guiding the user through steps to set a root password, remove anonymous users, disallow remote root login, and remove the test database. It's essential for hardening the database. ```shell $ sudo mariadb-secure-installation ``` -------------------------------- ### Example Vultr Dynamic DNS Client Configuration Source: https://docs.vultr.com/md/how-to-setup-dynamic-dns This is an example of a properly configured JSON file for the Vultr Dynamic DNS client. It includes a placeholder for the Vultr API key, the domain 'example.com', and specifies that both the root domain ('') and the subdomain 'server2' should have their 'A' records updated dynamically. This setup is suitable for managing dynamic IP addresses for a main domain and a specific server. ```json { "api_key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "domain": "example.com", "dynamic_records": [ "", "server2" ] } ``` -------------------------------- ### Configure TightVNC Systemd Service Source: https://docs.vultr.com/md/install-gui-environment-for-ubuntu This systemd service file configures TightVNC to run as a background service. It specifies the user, VNC parameters like color depth and resolution, and commands to start and stop the VNC server. Ensure 'example_user' is replaced with your actual username. ```ini [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=forking User=example_user PIDFile=/home/example_user/.vnc/%H:%i.pid ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1 ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i ExecStop=/usr/bin/vncserver -kill :%i [Install] WantedBy=multi-user.target ``` -------------------------------- ### Configure DStack CLI Source: https://docs.vultr.com/md/how-to-deploy-dev-environments-with-dstack-on-vultr Configures the DStack command-line interface to connect to the running DStack server. It requires the server URL, project name, and authentication token obtained after starting the server. ```bash dstack config --url \ --project main \ --token ``` -------------------------------- ### Initialize Next.js Project Source: https://docs.vultr.com/md/how-to-automate-cicd-pipelines-for-cypress-testing-with-github-actions Creates a new Next.js project using `npx` and the `create-next-app` package. You will be prompted to confirm package installation and configure project settings like TypeScript, ESLint, and Tailwind CSS. Replace `my-project` with your desired application name. ```console npx create-next-app@latest my-project ``` -------------------------------- ### Add Pritunl Repository Source: https://docs.vultr.com/md/how-to-install-and-setup-pritunl-vpn-server-on-ubuntu-2404 Integrates the Pritunl stable repository into the APT system. This makes Pritunl packages available for installation. The command writes the repository details to a new file and specifies the GPG key for secure package verification. ```bash sudo tee /etc/apt/sources.list.d/pritunl.list << EOF deb [ signed-by=/usr/share/keyrings/pritunl.gpg ] https://repo.pritunl.com/stable/apt noble main EOF ``` -------------------------------- ### Import NodeSource GPG Key for Ubuntu Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 Imports the GPG key for the NodeSource repository to verify package integrity when installing Node.js on Ubuntu. This is a prerequisite for adding the NodeSource repository. ```bash $ wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add - ``` -------------------------------- ### Monitor Cloudron Setup Logs Source: https://docs.vultr.com/md/how-to-install-cloudron-on-ubuntu-20-04 This command allows you to monitor the Cloudron setup process in real-time by tailing the setup log file. This is useful for troubleshooting or observing the installation progress. ```bash $ tail -f /var/log/cloudron-setup.log ``` -------------------------------- ### Download Cloudron Setup Script Source: https://docs.vultr.com/md/how-to-install-cloudron-on-ubuntu-20-04 This command downloads the Cloudron setup script from its official URL using wget. Ensure you have wget installed on your server. This script is the primary installer for Cloudron. ```bash # wget https://cloudron.io/cloudron-setup ``` -------------------------------- ### Go Hello World Application Source: https://docs.vultr.com/md/how-to-install-go-on-debian-12 A basic Go program that prints the message 'Greetings from Vultr' to the console. It demonstrates a simple 'Hello, World!' style application. ```go package main import "fmt" func main() { fmt.Println("Greetings from Vultr") } ``` -------------------------------- ### Select Redis Database Source: https://docs.vultr.com/md/how-to-install-redis-on-ubuntu-2204 This command selects a specific database on the Redis server to work with. Databases are typically numbered starting from 0. For example, 'SELECT 1' targets the second database. ```console 127.0.0.1:6379> SELECT 1 ``` -------------------------------- ### Scan SonarQube Example Project Source: https://docs.vultr.com/md/how-to-use-sonarqube-on-ubuntu-22-04-lts Tests the SonarScanner installation by cloning and scanning a provided example project from GitHub. This requires downloading the example, extracting it, and running the scanner with a login token. ```bash mkdir ~/sonar-example-test && cd ~/sonar-example-test wget https://github.com/SonarSource/sonar-scanning-examples/archive/master.zip unzip master.zip cd sonar-scanning-examples-master/sonarqube-scanner sonar-scanner -D sonar.login= ``` -------------------------------- ### Verify Sample Files (Linux Console) Source: https://docs.vultr.com/md/how-to-migrate-linode-block-storage-volumes-to-vultr-block-storage Lists the contents and details of the sample directory on the mounted Linode Block Storage volume, confirming that the sample files were created successfully. ```bash ls -lh /mnt//sample-directory ``` -------------------------------- ### Navigate to Go Project Directory Source: https://docs.vultr.com/md/how-to-install-go-on-debian-12 Changes the current working directory to the newly created 'go-sample' directory. This ensures subsequent commands are executed within the project's context. ```bash cd go-sample ``` -------------------------------- ### Kubernetes Commands for Deployment and Service Management Source: https://docs.vultr.com/md/how-to-set-up-nginx-ingress-controller-with-ssl-on-kubernetes This snippet shows essential kubectl commands for applying Kubernetes manifest files and retrieving deployment and service information. 'kubectl apply' creates or updates resources, while 'kubectl get deployments' and 'kubectl get services' allow for verification of the deployed resources. ```bash kubectl apply -f app1-deploy.yaml kubectl apply -f app2-deploy.yaml kubectl get deployments kubectl apply -f app1-svc.yaml kubectl apply -f app2-svc.yaml kubectl get services ``` -------------------------------- ### Install and Manage RabbitMQ Server Source: https://docs.vultr.com/md/how-to-install-rabbitmq-on-debian-12 Installs the RabbitMQ server package on Debian 12, checks its running status, enables it to start on boot, and starts the service. This command ensures RabbitMQ is operational. ```bash sudo apt install rabbitmq-server -y --fix-missing ``` ```bash sudo systemctl status rabbitmq-server ``` ```bash sudo systemctl enable rabbitmq-server ``` ```bash sudo systemctl start rabbitmq-server ``` -------------------------------- ### Caddyfile Virtual Host Configuration Source: https://docs.vultr.com/md/how-to-install-caddy-web-server-on-ubuntu-2004 Defines a Caddy virtual host for 'example.com'. It sets up TLS using an provided email, specifies the document root, enables a file server with 'index.html' as the index file, and configures console logging to '/var/log/caddy/example.log'. ```ini example.com { tls admin@example.com root * /var/www/example.com file_server { index index.html } log { output file /var/log/caddy/example.log format console } } ``` -------------------------------- ### Webpack Configuration for Project Bundling Source: https://docs.vultr.com/md/how-to-deploy-a-mern-application-on-ubuntu-20-04 This JavaScript configuration file sets up Webpack for the project. It specifies the entry point for the application, defines rules for handling JavaScript and JSX files using Babel, and includes a plugin to generate an HTML file from a template. ```javascript module.exports = { entry: "./src/public/App.jsx", module: { rules: [ { test: /\.(js|jsx)$/, use: "babel-loader", }, ], }, plugins: [ new (require("html-webpack-plugin"))({ template: "./src/public/index.html", }), ], }; ```