### Example Initial Data Configuration Source: https://github.com/dbeaver/cloudbeaver/wiki/Initial-data-configuration This JSON configuration defines the administrator credentials and predefined teams with their respective permissions. It is used during the initial server setup. ```json { adminName: "cbadmin", adminPassword: "cbadmin_password", teams: [ { subjectId: "admin", teamName: "Admin", description: "Administrative access. Has total and full authority.", permissions: ["admin"] }, { subjectId: "user", teamName: "User", description: "Standard user", permissions: [] } ] } ``` -------------------------------- ### Create .env File from Example (Windows) Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Enterprise-deployment-from-docker-compose Copy the example environment file to create your .env file in the cloudbeaver-deploy directory on Windows. ```bash cp .env.example .env ``` -------------------------------- ### Install Prerequisites on Ubuntu Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Installs Node.js and Yarn repositories and then installs required packages including OpenJDK, Maven, Yarn, and Node.js. ```bash curl -sL 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 curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash - ``` ```bash sudo apt update sudo apt install openjdk-21-jdk maven yarn nodejs npm ``` -------------------------------- ### Install License using CLI Source: https://github.com/dbeaver/cloudbeaver/wiki/How-to-Import-License Use this command to install a license file from the command line within the service container. This method is useful for automated setups or headless servers and does not require an API token. ```bash docker compose exec ./cbvr.sh import-license \ -input-file /opt/cloudbeaver//CB-471MUZET-ZKLX.txt ``` -------------------------------- ### Example Product Settings Configuration Source: https://github.com/dbeaver/cloudbeaver/wiki/Product-configuration-parameters This JSON snippet shows an example of the product settings configuration within the main server configuration file. It includes settings for localization, theming, log viewer, SQL editor, and SQL proposals, utilizing environment variables for dynamic configuration. ```json productSettings: { "core.localization.language": "${CLOUDBEAVER_CORE_LOCALIZATION:en}", "core.theming.theme": "${CLOUDBEAVER_CORE_THEMING_THEME:light}", "plugin.log-viewer.disabled": "${CLOUDBEAVER_LOG_VIEWER_DISABLED:false}", "plugin.log-viewer.logBatchSize": "${CLOUDBEAVER_LOG_VIEWER_LOG_BATCH_SIZE:2}", "plugin.log-viewer.maxLogRecords": "${CLOUDBEAVER_LOG_VIEWER_MAX_LOG_RECORDS:2000}", "plugin.sql-editor.autoSave": "${CLOUDBEAVER_SQL_EDITOR_AUTOSAVE:true}", "plugin.sql-editor.disabled": "${CLOUDBEAVER_SQL_EDITOR_DISABLED:false}", "plugin.sql-editor.maxFileSize": "${CLOUDBEAVER_SQL_EDITOR_MAX_FILE_SIZE:10240}", "sql.proposals.insert.table.alias": "${CLOUDBEAVER_SQL_PROPOSALS_INSERT_TABLE_ALIAS:PLAIN}" }, ``` -------------------------------- ### Run Backend Server (macOS/Linux) Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Start the backend server by running the execution script. ```bash ./run-cloudbeaver-server.sh ``` -------------------------------- ### Run Backend Server (Windows) Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Start the backend server by running the execution script. ```batch ./run-server.bat ``` -------------------------------- ### Start PostgreSQL Container Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Workspace-Backup Starts the PostgreSQL container if it is not already running. This is a prerequisite for restoring the database. ```bash docker-compose up -d postgres ``` -------------------------------- ### Start Ladle for Component Development Source: https://github.com/dbeaver/cloudbeaver/blob/devel/webapp/common-react/@dbeaver/ui-kit/README.md Use this command to start Ladle, which provides a sandbox environment for developing and testing React components in isolation. ```bash yarn docs ``` -------------------------------- ### Run Backend Server (Windows) Source: https://github.com/dbeaver/cloudbeaver/blob/devel/webapp/readme.md Starts the CloudBeaver backend server. Ensure you are in the 'cloudbeaver' directory. ```batch ./run-cloudbeaver-server.bat ``` -------------------------------- ### Create Environment File Source: https://github.com/dbeaver/cloudbeaver/wiki/Getting-started Copy the example environment file to create your .env file for CloudBeaver configuration. Remember to change the default database password. ```bash cp .env.example .env ``` ```bash nano .env ``` -------------------------------- ### Webpack Product Development Server Configuration Source: https://github.com/dbeaver/cloudbeaver/wiki/Plugin-system Configuration for starting a development server for a product build using `core-cli-build`. ```json "dev": "core-cli-build serve --mode=development --progress --config=../core-cli/configs/webpack.product.dev.config.js", ``` -------------------------------- ### Run Web Application Development Server (macOS/Linux) Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Start the web application development server, specifying the backend server's URL. ```bash server=http://localhost:8978/ yarn dev ``` -------------------------------- ### Run Web Application Development Server (Windows Command Prompt) Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Start the web application development server, specifying the backend server's URL. ```cmd set server=http://localhost:8978/ && yarn dev ``` -------------------------------- ### CSV User Import Example Source: https://github.com/dbeaver/cloudbeaver/wiki/How-to-Reassign-License This is an example of the CSV file format for importing users for a group license. Ensure each line contains the user's email and name, separated by a semicolon. ```csv alice@dbeaver.com;Alice Cooper user-bob;Bob Bundy ``` -------------------------------- ### Start Cloudbeaver Server with Docker Source: https://github.com/dbeaver/cloudbeaver/wiki/Configuring-HTTPS-for-Jetty-server Command to run the Cloudbeaver EE container using Docker, mapping a workspace volume and exposing the server port. ```bash docker run --name={container name} -p 8978:8978 -ti -v {absolute path to workspace}:/opt/cloudbeaver/workspace dbeaver/cloudbeaver-ee:{container name} ``` -------------------------------- ### Run Web Application Development Server (Windows PowerShell) Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Start the web application development server, specifying the backend server's URL. ```powershell $env:server="http://localhost:8978/"; yarn dev ``` -------------------------------- ### Set JAVA_OPTS for Manual Start Source: https://github.com/dbeaver/cloudbeaver/wiki/Command-line-parameters Configure JVM memory settings by exporting the JAVA_OPTS environment variable before running the server script. This is useful for manual server startups. ```sh export JAVA_OPTS=-Xmx1000m ./run-cloudbeaver-server.sh ``` -------------------------------- ### Run CloudBeaver EE Docker Container with Workspace Volume Source: https://github.com/dbeaver/cloudbeaver/wiki/How-to-Migrate-your-CloudBeaver-Enterprise-Workspace Use this command to start a CloudBeaver EE Docker container, mapping a local directory to the container's workspace. This is useful for initial setup or when migrating to a new workspace location. ```shell docker run --name cloudbeaver-ee --rm -ti -p 8978:8978 -v /var/cloudbeaver/workspace:/opt/cloudbeaver/workspace dbeaver/cloudbeaver-ee:latest ``` -------------------------------- ### Run Development Build with File Watching Source: https://github.com/dbeaver/cloudbeaver/wiki/Plugin-system Starts a development server for a specific product (e.g., `product-default`) that watches for file changes and rebuilds automatically. It also proxies backend requests to the specified server URL. ```bash yarn lerna run dev --stream --scope=@cloudbeaver/product-default -- -- --env server=http://backend.server:8095 ``` -------------------------------- ### Install Docker Compose on macOS Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Enterprise-deployment-from-docker-compose Install Docker Compose using Homebrew on macOS if it is not already bundled with Docker Desktop. ```bash brew install docker-compose ``` -------------------------------- ### Build Backend Server (Windows) Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Navigate to the deploy directory and execute the build script to compile the backend and frontend. ```batch cd deploy ./build.bat ``` -------------------------------- ### Build Backend Server (macOS/Linux) Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Navigate to the deploy directory and execute the build script to compile the backend and frontend. ```bash cd deploy ./build.sh ``` -------------------------------- ### Verify Tool Installations on macOS Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Enterprise-deployment-from-docker-compose Check the installed versions of Docker, Docker Compose, and Git on your macOS system to ensure they meet the requirements. ```bash docker --version docker-compose --version git --version ``` -------------------------------- ### Example Secret Key for JWT Source: https://github.com/dbeaver/cloudbeaver/wiki/JWT-authentication A sufficiently large and secure secret key is required for JWT generation. This example demonstrates a robust key. ```text 8Sa8sdfkj980stCLyV6XICnI2TLoFcgzwtwgX94joMiaMnB8PTft6EDBXBqJpiIieeg7b26b9oiXKUx0Os9i1lmGDi1hpB2eOIiVuLQNxAZ9CMdSctnchzprIjgnKOeKaYHjUVZpNlnckxcOzzix4hLPsdfsdfsdffq2WyFNJ2Juw1OnEedA8MbgzSyfqbL0s02gXHLiRdakxbhsWg6NVvUMMTcsDLQZDxAzvLPD0MtKEIy6Vn8kSC0icog5Q187Uw0swlxNNAnt82cLcBaOwoHUFUOjZet3Rdu ``` -------------------------------- ### Example SQL Queries for Multi Source Driver Source: https://github.com/dbeaver/cloudbeaver/wiki/Database-driver-Files-MultiSource Demonstrates simple and complex SQL queries supported by the Multi Source driver. Simple queries read data directly, while complex queries trigger data import into an internal database. ```sql SELECT * FROM table ``` ```sql WHERE, JOIN, ORDER BY, GROUP BY ``` -------------------------------- ### Example JDBC URL for DBeaver Proxy Driver Source: https://github.com/dbeaver/cloudbeaver/wiki/Connect-Tableau-to-a-database-using-DBeaver-Proxy-Driver This is an example of the JDBC URL format required to connect to a database using the DBeaver Proxy Driver in Tableau. ```sql jdbc:dbeaver-upd:your-domain.com:443:Shared:postgres-jdbc-194f450b17f-63a1de2f34b44deb ``` -------------------------------- ### Start CloudBeaver Enterprise Cluster Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Enterprise-deployment-from-docker-compose Use Docker Compose to start the CloudBeaver Enterprise services in detached mode. Ensure your .env file is configured correctly before running this command. ```bash docker compose up -d ``` -------------------------------- ### Navigate to Webapp Product Directory Source: https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy Open a new terminal and change your directory to the web application's product folder. ```bash cd webapp/packages/product-default ``` -------------------------------- ### Bootstrap Cloudbeaver Dependencies Source: https://github.com/dbeaver/cloudbeaver/wiki/Plugin-system Execute this command in the `cloudbeaver/webapp` directory to load all dependencies and initialize workspaces. ```bash yarn run bootstrap ``` -------------------------------- ### Restart CloudBeaver with Docker Compose Source: https://github.com/dbeaver/cloudbeaver/wiki/Admin-Password-Recovery Use these commands to stop and then start the CloudBeaver service when running with Docker Compose. ```bash docker-compose stop ``` ```bash docker-compose start ``` -------------------------------- ### Docker Quick-Start with Automatic Admin Configuration Source: https://context7.com/dbeaver/cloudbeaver/llms.txt This command starts CloudBeaver in a Docker container, mapping ports, setting environment variables for server name, URL, and admin credentials, and mounting a volume for workspace data. ```bash # Docker quick-start with automatic admin configuration docker run -d \ --name cloudbeaver \ -p 8978:8978 \ -e CB_SERVER_NAME="My CloudBeaver" \ -e CB_SERVER_URL="https://myserver.com:8978/" \ -e CB_ADMIN_NAME="administrator" \ -e CB_ADMIN_PASSWORD="Admin@1234!" \ -v /data/cloudbeaver:/opt/cloudbeaver/workspace \ dbeaver/cloudbeaver:latest ``` -------------------------------- ### Set User Credentials Source: https://context7.com/dbeaver/cloudbeaver/llms.txt Sets the credentials for a specific user and provider. This is useful for initial setup or updating authentication details. ```APIDOC ## POST /api/gql ### Description Sets the credentials for a specific user and provider. ### Method POST ### Endpoint /api/gql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL mutation string. - **variables** (object) - Required - The variables for the mutation. - **userId** (ID!) - Required - The ID of the user. - **providerId** (ID!) - Required - The ID of the provider. - **credentials** (Object!) - Required - The credentials object. - **password** (string) - Required - The user's password. ### Request Example ```json { "query": "mutation setUserCredentials($userId: ID!, $providerId: ID!, $credentials: Object!) { setUserCredentials(userId: $userId, providerId: $providerId, credentials: $credentials) }", "variables": { "userId": "jsmith", "providerId": "local", "credentials": { "password": "Initial@Pass1" } } } ``` ### Response #### Success Response (200) - **data** (object) - Contains the result of the mutation. - **setUserCredentials** (any) - The result of the setUserCredentials operation. ``` -------------------------------- ### Clone CloudBeaver Deployment Repository Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Enterprise-deployment-from-docker-compose Clone the official CloudBeaver deployment repository to your local machine to begin the setup process. ```bash git clone https://github.com/dbeaver/cloudbeaver-deploy ``` -------------------------------- ### ExampleComponent.m.css - CSS Module Styles Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Styling-components This CSS Module file defines styles for the ExampleComponent. It includes basic styling for elements like box, header, message, and switch, along with a specific style for the switch when its mode is 'disabled'. ```css .box { border-radius: 3px; border: solid 1px; } .header { margin: 0; } .message { padding: 8px; } .status { color: red; } .switch { padding: 2px, 4px; } .switch[data-s-mode="disabled"] { opacity: 0.75; } ``` -------------------------------- ### Clone CloudBeaver Deploy Repository Source: https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Workspace-Backup Clones the cloudbeaver-deploy repository from GitHub. Navigate to the cloned directory if performing a new installation and restoring the database. ```bash git clone https://github.com/dbeaver/cloudbeaver-deploy.git ``` ```bash cd cloudbeaver-deploy ``` -------------------------------- ### Open (Initialize) Database Connection Source: https://context7.com/dbeaver/cloudbeaver/llms.txt Establishes the actual JDBC connection to the database using a connection ID. Can optionally save credentials. ```bash curl -X POST https://localhost:8978/api/gql \ -H 'Content-Type: application/json' \ -b cookies.txt \ -d '{ "query": "mutation initConnection($projectId: ID!, $connectionId: ID!, $credentials: Object, $saveCredentials: Boolean) { connection: initConnection(projectId: $projectId, id: $connectionId, credentials: $credentials, saveCredentials: $saveCredentials) { id connected features } }", "variables": { "projectId": "g_GlobalConfiguration", "connectionId": "abc123", "credentials": { "userName": "dbuser", "userPassword": "dbpass" }, "saveCredentials": false } }' ``` -------------------------------- ### Project Structure Overview Source: https://github.com/dbeaver/cloudbeaver/wiki/Frontend-development-guidelines Illustrates the directory structure of the web application, including core packages, plugins, and product-specific folders. ```tree |-webapp |-node_modules # dependencies |-packages # packages folder (contains core-* and plugin-*) |-(plugin|core)-name # plugin name (without @cloudbeaver/) |-node_modules # dependencies |-lib # after the build will contain the artifact |-public # put static assets to this folder |-src # keep source files here |-locales # contains localization files |-en.ts # contains array of token localizations |-index.ts # contains re-exports |-manifest.ts # contains list of services, plugin name and description |-PluginBootstrap.ts # common plugin registration and initialization logic |-LocaleBootstrap.ts # plugin localization |-package.json |-tsconfig.json |-plugin-name-administration # administration plugin name (without @cloudbeaver/), structure are the same as for core/plugin packages |-product-name # product name (without @cloudbeaver/) |-node_modules |-lib |-public |-src |-config.json5 # product default configuration |-index.html.ejs # html page template |-index.ts # plugins import & application bootstrap |-manifest.ts # contains list of services, product name and description |-ProductBootstrap.ts # common product registration and initialization logic |-package.json |-tsconfig.json ``` -------------------------------- ### Get Current User Info Source: https://context7.com/dbeaver/cloudbeaver/llms.txt Retrieves information about the currently active user, including their ID, display name, role, and associated teams. ```APIDOC ## POST /api/gql ### Description Retrieves information about the currently active user. ### Method POST ### Endpoint /api/gql ### Parameters #### Query Parameters - **query** (String) - Required - The GraphQL query to get the active user information. ### Request Example ```json { "query": "query { user: activeUser { userId displayName isAnonymous authRole linkedAuthProviders teams { teamId teamName } } }" } ``` ### Response #### Success Response (200) - **data.user** (Object) - Information about the active user, including `userId`, `displayName`, `isAnonymous`, `authRole`, `linkedAuthProviders`, and `teams`. ``` -------------------------------- ### User Administration: Create User using GraphQL Source: https://context7.com/dbeaver/cloudbeaver/llms.txt Creates a new user with specified user ID, authentication role, and enabled status. Requires these parameters. ```bash # Create user curl -X POST https://localhost:8978/api/gql \ -H 'Content-Type: application/json' \ -b cookies.txt \ -d '{ "query": "mutation createUser($userId: ID!, $authRole: String, $enabled: Boolean!) { user: createUser(userId: $userId, authRole: $authRole, enabled: $enabled) { userId enabled authRole grantedTeams } }", "variables": { "userId": "jsmith", "authRole": "user", "enabled": true } }' ``` -------------------------------- ### Open (Initialize) a Connection Source: https://context7.com/dbeaver/cloudbeaver/llms.txt Establishes the actual JDBC connection to the database using the provided connection ID and credentials. ```APIDOC ## POST https://localhost:8978/api/gql ### Description Establishes the actual JDBC connection to the database. ### Method POST ### Endpoint https://localhost:8978/api/gql ### Parameters #### Query Parameters - **query** (String!) - The GraphQL mutation for initializing a connection. - **variables** (Object!) - Variables for the mutation. - **projectId** (ID!) - The ID of the project. - **connectionId** (ID!) - The ID of the connection to initialize. - **credentials** (Object) - Database credentials for initialization. - **userName** (String) - The username. - **userPassword** (String) - The password. - **saveCredentials** (Boolean) - Whether to save the provided credentials. ### Request Example ```json { "query": "mutation initConnection($projectId: ID!, $connectionId: ID!, $credentials: Object, $saveCredentials: Boolean) { connection: initConnection(projectId: $projectId, id: $connectionId, credentials: $credentials, saveCredentials: $saveCredentials) { id connected features } }", "variables": { "projectId": "g_GlobalConfiguration", "connectionId": "abc123", "credentials": { "userName": "dbuser", "userPassword": "dbpass" }, "saveCredentials": false } } ``` ### Response #### Success Response (200) - **data.connection.id** (ID) - The ID of the initialized connection. - **data.connection.connected** (Boolean) - Indicates if the connection is now established. - **data.connection.features** (Array) - List of features available with the established connection. #### Response Example ```json { "data": { "connection": { "id": "abc123", "connected": true, "features": ["connected", "manageable"] } } } ``` ``` -------------------------------- ### Create Project via GraphQL API Source: https://context7.com/dbeaver/cloudbeaver/llms.txt Use this mutation to create a new project with a specified name and description. The project ID will be returned upon successful creation. ```bash curl -X POST https://localhost:8978/api/gql \ -H 'Content-Type: application/json' \ -b cookies.txt \ -d '{ "query": "mutation createProject($config: ResourceProjectConfig!) { project: rmCreateProject(config: $config) { id name description } }", "variables": { "config": { "name": "Analytics Team", "description": "Shared analytics scripts" } } }' ```