======================== CODE SNIPPETS ======================== TITLE: Install Cloudron Setup Script on Ubuntu DESCRIPTION: This snippet provides the shell commands to download the Cloudron setup script, grant it executable permissions, and then run it on a fresh Ubuntu Noble 24.04 (x64) server. This initiates the primary Cloudron installation process. SOURCE: https://docs.cloudron.io/installation LANGUAGE: Shell CODE: ``` wget https://cloudron.io/cloudron-setup chmod +x cloudron-setup ./cloudron-setup ``` ---------------------------------------- TITLE: Install a Built Cloudron Application DESCRIPTION: Demonstrates how to install a pre-built Cloudron application using the `cloudron install` command. The output shows the various stages of the installation process, including image download, addon setup, container creation, and health checks. SOURCE: https://docs.cloudron.io/guides/multiple-databases-lamp LANGUAGE: bash CODE: ``` ~/lamp-multidb-app$ cloudron install Location: lamp-multidb App is being installed. => Queued => Registering subdomains => Downloading image .... => Setting up addons .............. => Creating container => Wait for health check ........ App is installed. ``` ---------------------------------------- TITLE: Install Cloudron on a New Server for Restore DESCRIPTION: This script sequence is used to install the Cloudron platform on a new Ubuntu LTS server. It downloads the Cloudron setup script, grants it execute permissions, and then runs it. It is critical to specify the exact Cloudron version (`--version x.y.z`) that matches the version of the backup being restored to ensure compatibility and a successful restoration. SOURCE: https://docs.cloudron.io/backups LANGUAGE: Shell CODE: ``` wget https://cloudron.io/cloudron-setup chmod +x cloudron-setup ./cloudron-setup --version x.y.z # version must match your backup version ``` ---------------------------------------- TITLE: Install Cloudron App from Docker Image DESCRIPTION: Installs a Cloudron application using a specified Docker image. Can be configured for public or private registries. The 'cd' command ensures the user is in the correct directory before installation. SOURCE: https://docs.cloudron.io/packaging/tutorial LANGUAGE: bash CODE: ``` # be sure to be in the app directory cd tutorial-nodejs-app cloudron install --image username/nodejs-app:1.0.0 Location: app.example.com App is being installed. => Starting ... => Registering subdomains => Downloading image .... => Setting up collectd profile App is installed. ``` ---------------------------------------- TITLE: Install Cloudron CLI via npm DESCRIPTION: Installs the Cloudron command-line interface globally using npm, enabling users to interact with and manage Cloudron instances from their local machine. SOURCE: https://docs.cloudron.io/packaging/tutorial LANGUAGE: Shell CODE: ``` $ sudo npm install -g cloudron ``` ---------------------------------------- TITLE: Perform One-Time Application Initialization on Cloudron DESCRIPTION: This snippet demonstrates how to implement a one-time initialization routine for a Cloudron application. It checks for the existence of a marker file in the persistent `/app/data` directory to ensure setup commands are executed only during the very first installation, preventing re-execution on subsequent restarts or updates. SOURCE: https://docs.cloudron.io/packaging/cheat-sheet LANGUAGE: bash CODE: ``` if [[ ! -f /app/data/.initialized ]]; then echo "Fresh installation, setting up data directory..." # Setup commands here touch /app/data/.initialized echo "Done." fi ``` ---------------------------------------- TITLE: Specify Cloudron Version during Setup DESCRIPTION: This command-line instruction allows users to install a specific version of Cloudron during the setup process. This is particularly important when restoring from a backup to ensure the Cloudron version matches the backup version for successful restoration. SOURCE: https://docs.cloudron.io/backups LANGUAGE: Bash CODE: ``` cloudron-setup --version 3.3.1 ``` ---------------------------------------- TITLE: Install Firefly III Data Importer via Composer DESCRIPTION: These commands navigate to the application's data directory and then use Composer, a PHP dependency manager, to create a new project for the Firefly III Data Importer. This initiates the download and setup of the importer's core files. SOURCE: https://docs.cloudron.io/guides/community/firefly-iii-importer LANGUAGE: Bash CODE: ``` cd /app/data/ composer create-project firefly-iii/data-importer ``` ---------------------------------------- TITLE: Install ownCloud Client on Ubuntu 16.04 DESCRIPTION: This snippet provides a set of commands to install the ownCloud desktop client on Ubuntu 16.04, addressing issues with outdated packages. It uses `wget` to download the repository key, `apt-key` to add it, `sh` to configure the APT source list, and `apt-get` to update package lists and install the client. SOURCE: https://docs.cloudron.io/packages/owncloud LANGUAGE: bash CODE: ``` sudo wget -nv https://download.owncloud.com/repositories/desktop/Ubuntu_16.04/Release.key -O Release.key sudo apt-key add - < Release.key sudo sh -c "echo 'deb http://download.owncloud.com/repositories/desktop/Ubuntu_16.04/ /' > /etc/apt/sources.list.d/owncloud.list" sudo apt-get update sudo apt-get install owncloud-client ``` ---------------------------------------- TITLE: Install Kimai2 Demo Plugin via Git on Cloudron DESCRIPTION: This script demonstrates how to install a Kimai2 plugin by cloning its Git repository into the `/app/data/plugins` directory on a Cloudron instance. It then sets appropriate file permissions for the web server user (`www-data`) and reloads the Kimai2 application using the console command to activate the new plugin. SOURCE: https://docs.cloudron.io/packages/kimai LANGUAGE: bash CODE: ``` cd /app/data/plugins git clone https://github.com/Keleo/DemoBundle.git chown -R www-data.www-data . cd /app/code sudo -u www-data bin/console kimai:reload ``` ---------------------------------------- TITLE: Install Discourse Plugins on Cloudron DESCRIPTION: This snippet provides a sequence of shell commands to install a Discourse plugin. It involves navigating to the plugin directory, cloning the plugin's repository, setting file ownership, installing gems, migrating the database, and precompiling assets. A restart of the application is recommended after installation. SOURCE: https://docs.cloudron.io/packages/discourse LANGUAGE: bash CODE: ``` cd /app/code/plugins git clone chown -R cloudron:cloudron cd /app/code gosu cloudron:cloudron bundle exec rake plugin:install_all_gems gosu cloudron:cloudron bundle exec rake db:migrate gosu cloudron:cloudron bundle exec rake assets:precompile ``` ---------------------------------------- TITLE: Install MySQL 8.0 and Reconfigure Cloudron After Upgrade DESCRIPTION: This sequence of shell commands guides the user through stopping the Cloudron box service, optionally removing MySQL 5.7 (with a crucial note to preserve data), installing MySQL 8.0, re-running the Cloudron setup script, starting the box service, and finally rebooting the server to complete the database migration and system integration. SOURCE: https://docs.cloudron.io/guides/upgrade-ubuntu-20 LANGUAGE: shell CODE: ``` # systemctl stop box # apt remove mysql-server-5.7 # this is only needed, if it wasn't removed in the upgrade process above. if it asks, then be sure to preserve MySQL data. if it doesn't, it preserves it by default. # apt install mysql-server-8.0 # /home/yellowtent/box/setup/start.sh # systemctl start box # reboot ``` ---------------------------------------- TITLE: Start Apache with exec for Proper SIGTERM Handling DESCRIPTION: This `start.sh` script demonstrates how to properly start Apache using the `exec` command. By using `exec`, the Apache process replaces the shell process, ensuring that signals (like SIGTERM) sent to the parent process are directly forwarded to Apache, enabling graceful shutdown and proper signal handling within the container. SOURCE: https://docs.cloudron.io/packaging/cheat-sheet LANGUAGE: bash CODE: ``` echo "Starting apache" APACHE_CONFDIR="" source /etc/apache2/envvars rm -f "${APACHE_PID_FILE}" exec /usr/sbin/apache2 -DFOREGROUND ``` ---------------------------------------- TITLE: Install Cloudron CLI via npm DESCRIPTION: Instructions for installing the Cloudron command-line interface globally using npm on Linux/Mac. Notes that Windows support is limited and installation should not be on Cloudron itself. SOURCE: https://docs.cloudron.io/packaging/cli LANGUAGE: Shell CODE: ``` sudo npm install -g cloudron ``` ---------------------------------------- TITLE: Clone Cloudron Sample Application Repositories DESCRIPTION: Clones various sample application repositories (Node.js, TypeScript, PHP, Multi-process) from Cloudron's Git, providing ready-to-use starting points for packaging custom applications. SOURCE: https://docs.cloudron.io/packaging/tutorial LANGUAGE: Shell CODE: ``` $ git clone https://git.cloudron.io/docs/tutorial-nodejs-app ``` LANGUAGE: Shell CODE: ``` $ git clone https://git.cloudron.io/docs/tutorial-typescript-app ``` LANGUAGE: Shell CODE: ``` $ git clone https://git.cloudron.io/docs/tutorial-php-app ``` LANGUAGE: Shell CODE: ``` $ git clone https://git.cloudron.io/docs/tutorial-supervisor-app ``` ---------------------------------------- TITLE: Install and Build Redmine Themes DESCRIPTION: This sequence of commands clones a Redmine theme from GitHub, installs its Ruby dependencies using `bundle install`, and then runs its specific build script. Ensure you are in the `/app/data/themes/` directory before cloning the repository. SOURCE: https://docs.cloudron.io/packages/redmine LANGUAGE: Shell CODE: ``` cd /app/data/themes/ git clone https://github.com/hardpixel/minelab.git cd minelab bundle install ./bundle.sh ``` ---------------------------------------- TITLE: Open Cloudron App in Browser DESCRIPTION: Opens the installed Cloudron application in the default web browser. SOURCE: https://docs.cloudron.io/packaging/tutorial LANGUAGE: bash CODE: ``` cloudron open ``` ---------------------------------------- TITLE: Install Directus Extension on Cloudron DESCRIPTION: This shell script, located at `/app/pkg/install-extension.sh`, is used to install Directus extensions into the `/app/data/extensions` directory. The example demonstrates installing `directus-extension-wpslug-interface`. A restart of Directus is required for the extension to become active. If the script exits with 'Killed', it indicates an out-of-memory error, and the app's memory limit should be increased. SOURCE: https://docs.cloudron.io/packages/directus LANGUAGE: Shell CODE: ``` # /app/pkg/install-extension.sh directus-extension-wpslug-interface added 1 package in 1s Restart Directus to enable the extension ``` ---------------------------------------- TITLE: List Installed Etherpad Plugins via npm DESCRIPTION: This command uses 'npm ls' to list all installed Etherpad plugins. It filters the output to show only packages starting with 'ep_', which typically identifies Etherpad plugins. This is useful for troubleshooting plugin-related issues. SOURCE: https://docs.cloudron.io/packages/etherpad LANGUAGE: Shell CODE: ``` npm ls 2> /dev/null | grep ep_ ``` ---------------------------------------- TITLE: Install VA-API Drivers and Tools DESCRIPTION: This command installs the `vainfo` utility, `libva2` (VA-API runtime library), and `i965-va-driver` (Intel VA-API driver) on Debian/Ubuntu-based systems. These packages are essential for checking and enabling hardware video acceleration. SOURCE: https://docs.cloudron.io/packages/jellyfin LANGUAGE: bash CODE: ``` apt-get install vainfo libva2 i965-va-driver ``` ---------------------------------------- TITLE: Install Nextcloud Desktop Client via PPA on Ubuntu DESCRIPTION: Adds the official Nextcloud client PPA to Ubuntu's software sources, updates the package list, and then installs the desktop client. This method ensures the client is kept up-to-date through system package management. SOURCE: https://docs.cloudron.io/packages/nextcloud LANGUAGE: bash CODE: ``` sudo add-apt-repository ppa:nextcloud-devs/client sudo apt-get update sudo apt-get install nextcloud-client ``` ---------------------------------------- TITLE: Configure Application Start Script in Cloudron Dockerfile DESCRIPTION: This Dockerfile snippet shows how to add a custom start script (e.g., `start.sh`) to the application container and configure it as the default command. This script serves as the entry point for the application on Cloudron, allowing for pre-start operations and proper application launch. SOURCE: https://docs.cloudron.io/packaging/cheat-sheet LANGUAGE: Dockerfile CODE: ``` ADD start.sh /app/code/start.sh CMD [ "/app/code/start.sh" ] ``` ---------------------------------------- TITLE: View Cloudron App Logs DESCRIPTION: Displays real-time logs for a running Cloudron application. The '-f' flag can be used to follow logs. The example shows typical console output. SOURCE: https://docs.cloudron.io/packaging/tutorial LANGUAGE: bash CODE: ``` cloudron logs Using cloudron craft.selfhost.io 16:44:11 [main] Server running at port 8000 ``` ---------------------------------------- TITLE: Example CloudronManifest.json Structure DESCRIPTION: Illustrates the basic structure and common fields of a CloudronManifest.json file, including application metadata, port configuration, and addon declarations. This example provides a complete manifest for a sample application. SOURCE: https://docs.cloudron.io/packaging/manifest LANGUAGE: JSON CODE: ``` { "id": "com.example.test", "title": "Example Application", "author": "Girish Ramakrishnan ", "description": "This is an example app", "tagline": "A great beginning", "version": "0.0.1", "healthCheckPath": "/", "httpPort": 8000, "addons": { "localstorage": {} }, "manifestVersion": 2, "website": "https://www.example.com", "contactEmail": "support@clourdon.io", "icon": "file://icon.png", "tags": [ "test", "collaboration" ], "mediaLinks": [ "https://images.rapgenius.com/fd0175ef780e2feefb30055be9f2e022.520x343x1.jpg" ] } ``` ---------------------------------------- TITLE: Install Surfer CLI Tool DESCRIPTION: Installs the Cloudron Surfer command-line interface globally using npm. This tool enables users to interact with the Surfer application from their terminal for file management. SOURCE: https://docs.cloudron.io/packages/surfer LANGUAGE: npm CODE: ``` npm -g install cloudron-surfer ``` ---------------------------------------- TITLE: Install Theme for The Lounge via CLI DESCRIPTION: This snippet shows how to install a new theme for The Lounge using the `thelounge install` command. It uses `gosu` to ensure the command runs with the correct `cloudron` user permissions. Users should first find themes on npm. SOURCE: https://docs.cloudron.io/packages/thelounge LANGUAGE: shell CODE: ``` gosu cloudron:cloudorn thelounge install thelounge-theme-custom ``` ---------------------------------------- TITLE: Execute BigBlueButton Installation Script DESCRIPTION: This command downloads and executes the `bbb-install.sh` script for BigBlueButton installation. It configures the server with a specific version, hostname, and email for SSL certificate generation, ensuring the necessary components are set up for a functional BigBlueButton instance. SOURCE: https://docs.cloudron.io/packages/greenlight LANGUAGE: bash CODE: ``` wget -qO- https://raw.githubusercontent.com/bigbluebutton/bbb-install/v2.7.x-release/bbb-install.sh | bash -s -- -w -v focal-270 -s bbb.example.com -e info@example.com ``` ---------------------------------------- TITLE: Install LanguageTool N-gram Datasets DESCRIPTION: This shell script command downloads and unpacks specified n-gram datasets for LanguageTool. It shows an example of installing English and Spanish n-grams to a given path, typically `/app/data/ngrams`, which is crucial for advanced error detection. SOURCE: https://docs.cloudron.io/packages/languagetool LANGUAGE: Shell CODE: ``` # /app/pkg/install-ngrams.sh /app/data/ngrams en es ==> Installing en ngram dataset from https://languagetool.org/download/ngram-data/ngrams-en-20150817.zip /tmp/en.zip 100%[================================================================>] 8.35G 112MB/s in 77s ==> Unpacking en ngram dataset Archive: /tmp/en.zip creating: en/ creating: en/3grams/ inflating: en/3grams/_1e4.fdt inflating: en/3grams/_1e4.si extracting: en/3grams/_1e4.nvd ... inflating: en/1grams/_1p.si ==> en ngram dataset has been installed. ==> Done ``` ---------------------------------------- TITLE: Install and Configure YOURLS Plugin DESCRIPTION: This sequence of shell commands demonstrates how to install a YOURLS plugin by cloning its Git repository into the designated plugins directory (`/app/data/user/plugins/`). After cloning, it sets the correct file ownership to `www-data:www-data`, which is crucial for the web server to access and execute the plugin files. SOURCE: https://docs.cloudron.io/packages/yourls LANGUAGE: Shell CODE: ``` # cd /app/data/user/plugins # git clone https://github.com/apelly/YourlsBlacklistDomains.git # chown -R www-data:www-data YourlsBlacklistDomains ``` ---------------------------------------- TITLE: Adjust File Ownership for Cloudron Applications DESCRIPTION: This example illustrates how to correctly set file ownership for data stored in `/app/data` before the application starts. It's crucial for maintaining proper permissions across backup, update, and restore operations, ensuring the application's user (e.g., 'cloudron' or 'www-data') has the necessary access. SOURCE: https://docs.cloudron.io/packaging/cheat-sheet LANGUAGE: bash CODE: ``` chown -R cloudron:cloudron /app/data gosu cloudron:cloudron npm start ``` ---------------------------------------- TITLE: Cloudron Backup Storage Provider Configuration Guide DESCRIPTION: Comprehensive guide for configuring various external storage providers (Amazon S3, Backblaze B2, CIFS, Cloudflare R2) as backup destinations for Cloudron. This includes specific setup steps, recommendations for lifecycle rules, and details on access credential requirements for each service. SOURCE: https://docs.cloudron.io/backups LANGUAGE: APIDOC CODE: ``` Amazon S3 Configuration: - Create a bucket in S3. - Lifecycle rules: Avoid lifecycle rules that delete objects after a certain age when using 'rsync' format, as this can corrupt backups. Cloudron manages old backup cleanup. - Security Credentials: Use IAM user with the provided policy or root credentials. - Cloudron Dashboard: Choose 'Amazon S3' from the dropdown. Backblaze B2 Configuration: - Create a Backblaze B2 bucket. - Lifecycle rules: Change 'Lifecycle Settings' to 'Keep only the last version of the file' to avoid accumulating costs due to default versioning. - Access Keys: Create Access Key and Secret Access Key from 'Application Keys' section. Restrict access to the backup bucket with read/write permissions. - Key Format: Access Key Secret Key - Cloudron Dashboard: Choose 'Backblaze B2' from the dropdown. - Endpoint URL: Has the form 's3..backblazeb2.com', e.g., 's3.us-west-004.backblazeb2.com'. CIFS Mount Configuration: - Use for storage boxes like Hetzner and OVH that support Samba/CIFS. - Cloudron Dashboard: Choose 'CIFS Mount' from the dropdown. - Hetzner Storage Box Specifics: - SSHFS is recommended for better performance. - Remote Directory: '/backup' for main accounts, '/subaccount' for subaccounts. Cloudflare R2 Configuration: - Create a Cloudflare R2 bucket. - Generate S3 auth tokens for the bucket. - Cloudron Dashboard: Choose 'Cloudflare R2' from the dropdown. - Endpoint URL: The S3 endpoint is shown in the Cloudflare dashboard. Set the 'Endpoint' in Cloudron WITHOUT the bucket name at the end (Cloudflare dashboard URL often includes it). ``` ---------------------------------------- TITLE: Install Beszel Agent on Cloudron DESCRIPTION: This script sequence downloads the Beszel agent installer, grants it execution permissions, and then runs it. The installer sets up the agent, creates a dedicated user, adds it to the Docker group, and configures its systemd service, listening on port 45876. SOURCE: https://docs.cloudron.io/guides/community/beszel-agent LANGUAGE: bash CODE: ``` curl -sL https://get.beszel.dev -o /tmp/install-agent.sh chmod +x /tmp/install-agent.sh /tmp/install-agent.sh -p 45876 -k "$BESZEL_PUBLIC_KEY" ``` ---------------------------------------- TITLE: Cloudron Custom App Startup Script DESCRIPTION: Demonstrates how to create a custom startup script (`run.sh`) for a Cloudron app. This script executes before the main application starts, allowing for pre-initialization tasks like creating symlinks or setting up directories. SOURCE: https://docs.cloudron.io/packages/lamp LANGUAGE: bash CODE: ``` #!/bin/bash echo "This script is called before the app starts" # create symlinks rm -rf /app/data/var/cache mkdir -p /run/cache ln -sf /run/cache /app/data/var/cache ``` ---------------------------------------- TITLE: Install and Login to Cloudron CLI DESCRIPTION: Instructions to install the Cloudron command-line interface globally using npm and then log in to a Cloudron instance. SOURCE: https://docs.cloudron.io/guides/decrypt-backups LANGUAGE: Shell CODE: ``` sudo npm install -g cloudron cloudron login my.example.com ``` ---------------------------------------- TITLE: Nextcloud Calendar DAV URL Format Example DESCRIPTION: This snippet illustrates the typical structure of a Nextcloud calendar's DAV URL. This URL is essential for configuring external calendar synchronization clients and includes placeholders for your domain, username, and the specific calendar name. SOURCE: https://docs.cloudron.io/guides/community/nextcloud-oidc-dav-sync LANGUAGE: plaintext CODE: ``` https://YOUR.DOMAIN.TLD/remote.php/dav/calendars/my.DOMAIN.tld-USER.NAME/hackradt/ ``` ---------------------------------------- TITLE: Install GitLab Runner on Ubuntu DESCRIPTION: Provides commands to add the GitLab Runner repository and install the runner package on an Ubuntu system, preparing it for integration with a GitLab instance. This is the first step in setting up a CI/CD runner. SOURCE: https://docs.cloudron.io/packages/gitlab LANGUAGE: bash CODE: ``` # For ubuntu curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash sudo apt-get install gitlab-runner ``` ---------------------------------------- TITLE: WordPress Multisite Network Configuration Definitions DESCRIPTION: These PHP definitions are essential for completing the WordPress multisite network installation. They configure core multisite parameters such as enabling multisite mode, specifying subdomain installation, and defining the current site's domain, path, and IDs. These lines are added to `wp-config.php` as instructed by the WordPress Network Setup Tool. SOURCE: https://docs.cloudron.io/packages/wordpress-developer LANGUAGE: PHP CODE: ``` define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); define('DOMAIN_CURRENT_SITE', 'msite.cloudron.club'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); ``` ---------------------------------------- TITLE: Access Etherpad API and List All Pads with curl DESCRIPTION: This example demonstrates how to make a 'curl' request to the Etherpad API to list all available pads. The API key, found in "/app/data/APIKEY.txt", is required for authentication. This specific example uses API version 1.2.7 and the 'listAllPads' endpoint. SOURCE: https://docs.cloudron.io/packages/etherpad LANGUAGE: Shell CODE: ``` curl https://etherpad.domain/api/1.2.7/listAllPads?apikey=c5513793f24a6fbba161e4497b26c734ff5b2701fad0f1211097ccb405ea65c7 ``` ---------------------------------------- TITLE: SSH Local Port Forwarding Example DESCRIPTION: This example demonstrates how to set up local port forwarding to tunnel traffic from local port 8000 to port 4000 on the remote server's loopback interface (127.0.0.1). It shows a practical application of the `ssh -L` command for securely accessing a service running on the remote machine from the local environment. The `user@remote_server_ip` specifies the SSH user and the target server for the tunnel. SOURCE: https://docs.cloudron.io/guides/ssh-tunnel LANGUAGE: bash CODE: ``` ssh -L 8000:127.0.0.1:4000 user@remote_server_ip ``` ---------------------------------------- TITLE: Configure Rclone Remote Storage DESCRIPTION: Guides through the interactive setup of rclone to configure a remote storage backend, such as OneDrive. This setup is a prerequisite for using rclone with restic. SOURCE: https://docs.cloudron.io/guides/community/restic-rclone LANGUAGE: APIDOC CODE: ``` rclone config - Initiates an interactive setup process for rclone remotes. - Assumes the repository name "REPOSITORY" for subsequent commands. - Details: https://rclone.org/commands/rclone_config/ ``` ---------------------------------------- TITLE: Install and Log in to Cloudron CLI DESCRIPTION: This snippet demonstrates how to install the Cloudron CLI globally using npm and then log in to your Cloudron instance. The Cloudron CLI is essential for managing Cloudron applications and interacting with your Cloudron server. SOURCE: https://docs.cloudron.io/guides/multiple-databases-lamp LANGUAGE: bash CODE: ``` sudo npm install -g cloudron cloudron login my.example.com ``` ---------------------------------------- TITLE: Configure DNS Settings in Cloudron DESCRIPTION: This section details how to configure DNS settings within Cloudron, covering manual record setup, the No-op DNS backend for testing, and defining the DNS Zone Name for domain management, especially for delegated subdomains. SOURCE: https://docs.cloudron.io/domains LANGUAGE: APIDOC CODE: ``` Manual DNS Configuration: - Purpose: For domains not on supported DNS providers or when Wildcard DNS is not used. - Pre-installation Requirements: - Set 'my' subdomain A record to server's public IP. - Choose 'Manual' from DNS provider dropdown during Cloudron setup. - Manually set up DKIM and SPF records for email (details available in UI post-installation). - Setup A records for subdomains to server's public IP before app installation. - Let's Encrypt Integration: Requires port 80 open for HTTP validation. No-op DNS Backend: - Purpose: Disables Cloudron's automatic DNS functionality; intended for testing and development. - Behavior: Cloudron does not set up DNS automatically or check propagation. User is responsible for name resolution. DNS Zone Name: - Purpose: Defines the top-level domain managed by the DNS provider (e.g., 'example.com'). - Usage: Specify if the domain and subdomain are managed by different DNS providers (e.g., 'internal.example.com' for 'cloudron.internal.example.com' if 'internal.example.com' is delegated). ``` ---------------------------------------- TITLE: Manage Systemd Service for SSH Tunnel DESCRIPTION: These commands are used to manage the systemd service created for the persistent SSH tunnel. They allow reloading the systemd daemon, enabling the service to start on boot, and immediately starting the service. SOURCE: https://docs.cloudron.io/guides/ssh-tunnel LANGUAGE: bash CODE: ``` systemctl daemon-reload systemctl enable ssh-tunnel.service systemctl start ssh-tunnel.service ``` ---------------------------------------- TITLE: Install Pretix Plugin via pip DESCRIPTION: This snippet demonstrates how to activate the Pretix application's Python virtual environment and then use `pip` to install a new plugin. After successful installation, the application needs to be restarted to rebuild plugins and apply any necessary database migrations. SOURCE: https://docs.cloudron.io/packages/pretix LANGUAGE: Shell CODE: ``` source /var/pretix/venv/bin/activate (venv)$ pip install ``` ---------------------------------------- TITLE: Automated CI/CD Deployment with Surfer CLI DESCRIPTION: Example of integrating Surfer CLI into a CI/CD pipeline to automatically push build artifacts. This command uses an API token for authentication and specifies the target Surfer server and the destination path for the deployed files. SOURCE: https://docs.cloudron.io/packages/surfer LANGUAGE: shell CODE: ``` surfer put --token api-7e6d90ff-5825-4ebe-a85b-a68795055955 --server surfer.cloudron.ml dist/* / ``` ---------------------------------------- TITLE: Cloudron CLI Core Commands Reference DESCRIPTION: Comprehensive documentation for essential Cloudron CLI commands used to manage applications, including authentication, listing installed apps, viewing logs, and executing commands within app containers. SOURCE: https://docs.cloudron.io/packaging/cli LANGUAGE: APIDOC CODE: ``` cloudron login [--allow-selfsigned] - Authenticates the CLI with a Cloudron instance. - Parameters: - : The domain of your Cloudron instance (e.g., my.example.com). - --allow-selfsigned: (Optional) Use this option when connecting to a Cloudron instance with self-signed certificates. - Effect: Stores the authentication token in ~/.cloudron.json. cloudron list - Displays a list of all installed applications on the Cloudron instance. - Returns: A table with 'Id' (unique application instance ID) and 'Location' (domain where the app is installed). - Usage Note: Either 'Id' or 'Location' can be used as the argument for the --app option in other commands. cloudron logs --app [-f] - Views the logs of a specific application. - Parameters: - --app : The unique ID or domain of the application (e.g., blog.example.com or 52aae895-...). - -f: (Optional) Follows the logs in real-time (like 'tail -f'). - Note: Not all apps log to stdout/stderr; some may require direct filesystem access. cloudron exec --app - Provides a shell into the application's file system. - Parameters: - --app : The unique ID or domain of the application. - Usage Example: cloudron exec --app blog.example.com # Once inside the shell: tail -f /run/wordpress/wp-debug.log # Note: Log file paths are app-specific. ``` ---------------------------------------- TITLE: Build Custom Jupyter Notebook Docker Image DESCRIPTION: This Dockerfile example demonstrates how to create a custom Jupyter notebook image based on an existing one (e.g., `jupyter/all-spark-notebook`). It includes an additional step to install `git-lfs` using `conda`. The resulting image can then be pushed to a Docker registry and used with JupyterHub by updating the `c.DockerSpawner.image` setting. SOURCE: https://docs.cloudron.io/packages/jupyterhub LANGUAGE: Dockerfile CODE: ``` FROM quay.io/jupyter/all-spark-notebook RUN conda install --yes -c conda-forge git-lfs ``` ---------------------------------------- TITLE: Manually Install NodeBB Plugin or Theme DESCRIPTION: This snippet demonstrates how to manually install a NodeBB plugin or theme using npm within the application's code directory. It utilizes 'gosu' to execute the command as the 'cloudron' user, ensuring correct permissions. After execution, the NodeBB application must be restarted and the plugin/theme activated via the NodeBB dashboard. SOURCE: https://docs.cloudron.io/packages/nodebb LANGUAGE: Bash CODE: ``` cd /app/code /usr/local/bin/gosu cloudron:cloudron npm install nodebb-theme-timuu ``` ---------------------------------------- TITLE: SSH Remote Port Forwarding Example DESCRIPTION: This example demonstrates how to forward remote port 4000 on the SSH server to local port 8000 on the client machine. It clarifies that '127.0.0.1' refers to the local server's context and that forwarding can target any server reachable from the local machine. SOURCE: https://docs.cloudron.io/guides/ssh-tunnel LANGUAGE: bash CODE: ``` ssh -R 4000:127.0.0.1:8000 user@remote_server_ip ``` ---------------------------------------- TITLE: Curl Example for GeoIP API without IP Override DESCRIPTION: Demonstrates how to make a basic GET request to the GeoIP service's `/json` endpoint using `curl` to resolve the client's IP address. SOURCE: https://docs.cloudron.io/packages/geoip LANGUAGE: bash CODE: ``` curl https://geoip.example.com/json ``` ---------------------------------------- TITLE: Create PHP Session Directory and Set Permissions in Start Script DESCRIPTION: These commands should be included in your application's `start.sh` script. They create the necessary writable directory for PHP sessions (`/run/php/sessions`) and set the correct ownership to `www-data`, ensuring PHP can store session data. SOURCE: https://docs.cloudron.io/packaging/cheat-sheet LANGUAGE: bash CODE: ``` mkdir -p /run/php/sessions chown www-data:www-data /run/php/sessions ``` ---------------------------------------- TITLE: Create Custom Jirafeau Theme Directory DESCRIPTION: This sequence of shell commands creates a new custom theme by copying an existing theme's files. The new directory (mydarkhorse in this example) can then be modified and activated in Jirafeau's configuration. SOURCE: https://docs.cloudron.io/packages/jirafeau LANGUAGE: bash CODE: ``` # cd /app/data/media # cp -r /app/code/media.original/dark-courgette/ mydarkhorse ``` ---------------------------------------- TITLE: Configure rclone for Remote Storage DESCRIPTION: Guides through the interactive setup of rclone to connect to a remote storage backend, such as S3, using the `rclone config` command. This command initiates a wizard to define new remote connections. SOURCE: https://docs.cloudron.io/guides/community/restic-rclone LANGUAGE: Shell CODE: ``` rclone config ``` ---------------------------------------- TITLE: WordPress Reverse Proxy Configuration for Cloudron DESCRIPTION: PHP code snippet for `wp-config.php` to correctly handle WordPress installations behind a reverse proxy, specifically for Cloudron's Nginx setup. It adjusts `HTTP_HOST` and `HTTPS` based on `X-Forwarded` headers. SOURCE: https://docs.cloudron.io/packages/lamp LANGUAGE: php CODE: ``` /* http://cmanios.wordpress.com/2014/04/12/nginx-https-reverse-proxy-to-wordpress-with-apache-http-and-different-port/ http://wordpress.org/support/topic/compatibility-with-wordpress-behind-a-reverse-proxy https://wordpress.org/support/topic/wp_home-and-wp_siteurl */ // If WordPress is behind reverse proxy which proxies https to http if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on'; } ``` ---------------------------------------- TITLE: Download Nextcloud Desktop Client AppImage DESCRIPTION: Downloads the latest Nextcloud desktop client as a self-contained AppImage for Linux using `wget`. This provides a portable and executable client application that does not require traditional installation. SOURCE: https://docs.cloudron.io/packages/nextcloud LANGUAGE: bash CODE: ``` sudo wget -nv https://download.nextcloud.com/desktop/releases/Linux/latest -O Nextcloud.AppImage ``` ---------------------------------------- TITLE: Gitea CLI Administration Commands on Cloudron DESCRIPTION: This snippet provides examples for using the Gitea command-line interface on a Cloudron instance. Commands are executed as the 'git' user, specifying the `app.ini` configuration. It includes how to display help and how to change a user's password. SOURCE: https://docs.cloudron.io/packages/gitea LANGUAGE: bash CODE: ``` sudo -u git /home/git/gitea/gitea -c /run/gitea/app.ini --help ``` LANGUAGE: bash CODE: ``` sudo -u git /home/git/gitea/gitea -c /run/gitea/app.ini admin user change-password -u root -p changeme123 ``` ---------------------------------------- TITLE: Configure Well-Known Locations for Cloudron Services DESCRIPTION: This section describes how Cloudron handles `/.well-known/` URI prefixes for service discovery, specifically for Matrix and Mastodon, enabling federation and client discovery. SOURCE: https://docs.cloudron.io/domains LANGUAGE: APIDOC CODE: ``` Well-Known Locations Overview: - Purpose: Standardized URL path prefixes (/.well-known/) for common services and information. - Configuration: Editable in the 'Domains' view within Cloudron UI. Matrix Server Location: - Purpose: Enables Matrix federation and client discovery. - Endpoints Handled by Cloudron: - https://{domain}/.well-known/matrix/server: Required for server-to-server federation. - https://{domain}/.well-known/matrix/client: Required for client discovery of Matrix servers. - Configuration Details: - Specify Matrix hostname and port (e.g., 'matrix.domain.com:443'). - Port 443 is used by Synapse app on Cloudron, specify explicitly. - Requirement: An app must be installed on the bare domain (e.g., 'https://cloudron.club') for Cloudron to respond to these queries. Mastodon Server Location: - Purpose: Enables Mastodon federation. - Endpoint Handled by Cloudron: - https://{domain}/.well-known/host-meta: Required for federation. - Requirement: An app must be installed on the bare domain (e.g., 'https://cloudron.club') for Cloudron to respond to this query. ``` ---------------------------------------- TITLE: List Installed NodeBB Plugins DESCRIPTION: This command navigates to the NodeBB application's code directory and then executes the NodeBB CLI to list all currently installed plugins. This is useful for reviewing the active plugins before performing any management operations or troubleshooting. SOURCE: https://docs.cloudron.io/packages/nodebb LANGUAGE: Bash CODE: ``` cd /app/code ./nodebb plugins ``` ---------------------------------------- TITLE: Install Grafana Plugins via CLI DESCRIPTION: This command demonstrates how to install a Grafana plugin, such as 'grafana-worldmap-panel', using the 'grafana cli' tool. It specifies the home path and configuration file for Grafana. This operation typically requires access to the Web Terminal on Cloudron. SOURCE: https://docs.cloudron.io/packages/grafana LANGUAGE: Shell CODE: ``` /app/code/bin/grafana cli -homepath /app/code -config /run/grafana/custom.ini plugins install grafana-worldmap-panel ``` ---------------------------------------- TITLE: Run Cloudron Applications as Non-Root User with gosu DESCRIPTION: This command demonstrates the use of `gosu` to run the main application process with a specific non-root user and group (e.g., `cloudron:cloudron`). While Cloudron's `start.sh` runs as root for setup tasks, `gosu` ensures the application itself operates with the principle of least privilege for enhanced security. SOURCE: https://docs.cloudron.io/packaging/cheat-sheet LANGUAGE: bash CODE: ``` /usr/local/bin/gosu cloudron:cloudron node /app/code/.build/bundle/main.js ``` ---------------------------------------- TITLE: Configure and Install npm Packages from Verdaccio DESCRIPTION: Commands to configure the npm registry globally or per-project and install packages from a Verdaccio instance. The `npx verdaccio-openid` command is included as a prerequisite for authentication. SOURCE: https://docs.cloudron.io/packages/verdaccio LANGUAGE: bash CODE: ``` npx verdaccio-openid@latest --registry http://your-registry.com npm set registry https://your-registry.com ``` LANGUAGE: bash CODE: ``` npx verdaccio-openid@latest --registry http://your-registry.com npm install my-package --registry https://your-registry.com ``` ---------------------------------------- TITLE: Create Laravel Project using Composer on Cloudron DESCRIPTION: This snippet demonstrates how to initialize a new Laravel application within the Cloudron LAMP stack's web terminal. It involves switching to the `www-data` user to ensure correct file ownership and permissions, then navigating to the `/app/data` directory, which serves as the web server's document root, to create the Laravel project using Composer. This setup is crucial for the application to be accessible and function properly under the web server. SOURCE: https://docs.cloudron.io/guides/lamp-laravel LANGUAGE: Bash CODE: ``` su - www-data cd /app/data composer create-project laravel/laravel my-project ``` ---------------------------------------- TITLE: Build and Push Docker Image for Cloudron App DESCRIPTION: Builds a Docker image from the current directory and pushes it to a Docker registry. Requires 'docker login' for private registries. SOURCE: https://docs.cloudron.io/packaging/tutorial LANGUAGE: bash CODE: ``` docker build -t username/nodejs-app:1.0.0 . # push the image. if the push fails, you have to 'docker login' with your username docker push username/nodejs-app:1.0.0 ``` ---------------------------------------- TITLE: Install NFS Server on Cloudron DESCRIPTION: This command installs the NFS kernel server package on a Cloudron server, enabling it to share directories via NFS. This is the foundational step for setting up an NFS share. SOURCE: https://docs.cloudron.io/guides/nfs-share LANGUAGE: bash CODE: ``` sudo apt install nfs-kernel-server ``` ---------------------------------------- TITLE: Upgrade Ubuntu System Packages DESCRIPTION: This set of commands is used to prepare the system for an upgrade and then perform the package upgrade. `dpkg --configure -a` ensures all previously unpacked packages are configured. `apt update` refreshes the package index files, and `apt upgrade` installs the newest versions of all currently installed packages. SOURCE: https://docs.cloudron.io/guides/upgrade-ubuntu-20 LANGUAGE: Shell CODE: ``` # dpkg --configure -a # apt update # apt upgrade ``` ---------------------------------------- TITLE: Debug Cloudron LDAP Addon with ldapsearch DESCRIPTION: Provides examples of using the `ldapsearch` client via `cloudron exec` to debug LDAP connectivity and query users within the context of a Cloudron app. Includes commands for listing users and authenticating. SOURCE: https://docs.cloudron.io/packaging/addons LANGUAGE: bash CODE: ``` cloudron exec # list users ldapsearch -x -H "${CLOUDRON_LDAP_URL}" -D "${CLOUDRON_LDAP_BIND_DN}" -w "${CLOUDRON_LDAP_BIND_PASSWORD}" -b "${CLOUDRON_LDAP_USERS_BASE_DN}" # list users with authentication (Substitute username and password below) ldapsearch -x -H "${CLOUDRON_LDAP_URL}" -D cn=,${CLOUDRON_LDAP_USERS_BASE_DN} -w -b "${CLOUDRON_LDAP_USERS_BASE_DN}" ``` ---------------------------------------- TITLE: Curl Example for GeoIP API with Access Token DESCRIPTION: Illustrates how to authenticate requests to the GeoIP service by including the `accessToken` query parameter in a `curl` command. SOURCE: https://docs.cloudron.io/packages/geoip LANGUAGE: bash CODE: ``` curl https://geoip.example.com/json?accessToken=thetoken ``` ---------------------------------------- TITLE: Install Ruby Gems for Redmine Plugins DESCRIPTION: This command installs required Ruby gems for Redmine plugins. It should be executed from the `/app/code` directory within the Redmine application's web terminal to ensure all dependencies are met. SOURCE: https://docs.cloudron.io/packages/redmine LANGUAGE: Shell CODE: ``` # cd /app/code # bundle install ``` ---------------------------------------- TITLE: Installing Custom Node Modules for n8n DESCRIPTION: This snippet demonstrates how to specify custom Node.js modules and their versions for n8n to install automatically. The `EXTRA_NODE_MODULES` environment variable, set in `/app/data/env.sh`, takes a space-separated list of module names and versions. Modules will be installed upon app restart. SOURCE: https://docs.cloudron.io/packages/n8n LANGUAGE: Shell CODE: ``` export EXTRA_NODE_MODULES="handlebars@4.7.7 jsonata@2.0.2 marked@4.3.0" ``` ---------------------------------------- TITLE: Install Missing Unbound Anchor Utility DESCRIPTION: This command installs the unbound-anchor package, which is sometimes not automatically installed on certain VPS environments after an Ubuntu upgrade. This utility is essential for DNSSEC validation and proper functioning of DNS services. SOURCE: https://docs.cloudron.io/guides/upgrade-ubuntu-24 LANGUAGE: Shell CODE: ``` apt install unbound-anchor ``` ---------------------------------------- TITLE: Import Demo Data and Create Admin User for Apache Superset DESCRIPTION: This sequence of shell commands is executed within the Superset app's web terminal to initialize the environment, create an administrator user (`admin` with password `changeme`), and then load example datasets. This process is resource-intensive, requiring at least 2GB of memory for the app. SOURCE: https://docs.cloudron.io/packages/superset LANGUAGE: bash CODE: ``` source /app/pkg/env.sh superset fab create-admin --username admin --firstname Superset --lastname Admin --email admin@cloudron.local --password changeme superset load_examples ``` ---------------------------------------- TITLE: Configure Woodpecker Gitea Authentication DESCRIPTION: Example configuration for setting up Gitea as an authentication provider for Woodpecker CI. This involves exporting specific environment variables in the `/app/data/env.sh` file, including the Gitea URL, client ID, and secret obtained from an OAuth2 application created within Gitea. SOURCE: https://docs.cloudron.io/packages/woodpecker LANGUAGE: bash CODE: ``` export WOODPECKER_GITEA=true export WOODPECKER_GITEA_URL=https://gitea.cloudron.example export WOODPECKER_GITEA_CLIENT=1950a7f0-74e1-4003-8d51-6253eb673940 export WOODPECKER_GITEA_SECRET=gto_kgoizrbde5qv242q2waw7hocb5sa5snafqhwoeownflb4lml7dsa ``` ---------------------------------------- TITLE: Install Roundcube Plugin Dependencies with Composer DESCRIPTION: This shell script outlines the process for installing plugin dependencies using Composer within the Cloudron environment. It requires temporarily increasing the app's memory limit to 2GB due to Composer's resource requirements. After installation, ownership of the plugin directory is set to `www-data`. SOURCE: https://docs.cloudron.io/packages/roundcube LANGUAGE: Shell CODE: ``` cd /app/data/plugins/ composer install --no-dev chown -R www-data:www-data . ``` ---------------------------------------- TITLE: SOGo ActiveSync Client Setup Parameters DESCRIPTION: These parameters are essential for configuring an ActiveSync client, such as Windows Mail, to successfully connect and synchronize with SOGo. The instructions detail the required input fields including email address, password, username, mail domain, SOGo app domain, and the necessity of enabling SSL for secure communication. SOURCE: https://docs.cloudron.io/packages/sogo LANGUAGE: APIDOC CODE: ``` - Use the mailbox as the email address. For example, `girish@cloudron.example`. - Use the mailbox owner's password as the password. - Use the mailbox as the username. For example, `girish@cloudron.example`. - Use the mail domain as the Domain. For example, `cloudron.example`. - Use the SOGo app domain as the Server. For example, `sogo.cloudron.example`. - Make sure SSL is checked - Use the mailbox as the Account name. For example, `girish@cloudron.example`. ``` ---------------------------------------- TITLE: Apache Basic Authentication with Cloudron LDAP DESCRIPTION: Example Apache configuration for setting up basic authentication using Cloudron's exposed LDAP environment variables. This snippet secures a directory by requiring valid LDAP user credentials. SOURCE: https://docs.cloudron.io/packages/lamp LANGUAGE: apache config CODE: ``` Options +FollowSymLinks AllowOverride None Require valid-user AuthName "Cloudron LDAP Authentication" AuthBasicProvider ldap AuthType Basic AuthLDAPURL ${CLOUDRON_LDAP_URL}/${CLOUDRON_LDAP_USERS_BASE_DN}?username?sub?(username=*) AuthLDAPBindDN ${CLOUDRON_LDAP_BIND_DN} AuthLDAPBindPassword ${CLOUDRON_LDAP_BIND_PASSWORD} ``` ---------------------------------------- TITLE: Manage Cloudron App Environment Variables DESCRIPTION: Provides examples for managing environment variables within a Cloudron application using the `cloudron env` command. This includes setting multiple variables, unsetting, listing all, and retrieving a single variable's value. SOURCE: https://docs.cloudron.io/packaging/cli LANGUAGE: bash CODE: ``` cloudron env set --app blog.example.com RETRY_INTERVAL=4000 RETRY_TIMEOUT=12min cloudron env unset --app blog.example.com RETRY_INTERVAL cloudron env list --app blog.example.com cloudron env get --app blog.example.com RETRY_INTERVAL ``` ---------------------------------------- TITLE: Restart Docker and Configure Cloudron Network DESCRIPTION: Commands to reload the systemd daemon, unmask Docker to allow it to start, and then start the Docker service. Following this, a specific Docker network named 'cloudron' is created with predefined IPv4 and IPv6 subnets, which is essential for Cloudron's internal communication and application deployment. SOURCE: https://docs.cloudron.io/storage LANGUAGE: bash CODE: ``` systemctl daemon-reload systemctl unmask docker systemctl start docker systemctl status docker docker network create --subnet=172.18.0.0/16 --ip-range=172.18.0.0/20 --gateway 172.18.0.1 cloudron --ipv6 --subnet=fd00:c107:d509::/64 ```