### Initialize Portainer Admin Password Source: https://github.com/portainer/portainer-docs/blob/2.39/api/examples.md Use this API call to create an admin account and initialize Portainer on a fresh installation. This is equivalent to the initial setup prompt. ```bash http POST /api/users/admin/init Username="" Password="" ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/README.md Execute this command to install all necessary dependencies for developing the Portainer project. ```bash make deps ``` -------------------------------- ### Customize Portainer Setup Token Source: https://github.com/portainer/portainer-docs/blob/2.39/faqs/installing/setup-token.md Supply your own token during initial Portainer installation for scripted or automated setups. ```bash --setup-token ``` -------------------------------- ### Start a Container Source: https://github.com/portainer/portainer-docs/blob/2.39/api/examples.md Starts a previously created container using its ID and the environment ID. ```APIDOC ## Start a container ### Description Starts a Docker container using its ID. ### Method POST ### Endpoint /api/endpoints//docker/containers//start ### Parameters #### Headers - **X-API-Key** (string) - Required - The API key or JWT token for authentication. ``` -------------------------------- ### Restart Portainer Container (Docker) Source: https://github.com/portainer/portainer-docs/blob/2.39/faqs/installing/your-portainer-instance-has-timed-out-for-security-purposes-error-fix.md Stop and start the Portainer container to reset the 5-minute setup timer. If issues persist, remove and recreate the container. ```bash docker stop portainer docker start portainer ``` ```bash docker rm portainer docker run ``` -------------------------------- ### Install prerequisites for Docker repository Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/linux.md Installs necessary packages to allow apt to use a repository over HTTPS. ```bash sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common ``` -------------------------------- ### Example Docker Service List Output Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/reverse-proxy/traefik.md An example output of the 'docker service ls' command, showing deployed services and their status. ```text ID NAME MODE REPLICAS IMAGE PORTS lt21zrypsll6 portainer_agent global 1/1 portainer/agent:sts m6912ynwdcd7 portainer_portainer replicated 1/1 portainer/portainer-ee:sts tw2nb4i640e4 portainer_traefik replicated 1/1 traefik:latest *:80->80/tcp, *:443->443/tcp ``` -------------------------------- ### Install Wget on Linux Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/linux.md Installs the Wget utility on Debian-based Linux distributions using apt-get. ```bash sudo apt-get install wget ``` -------------------------------- ### Install Golang 1.17 on Linux Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/linux.md Installs Golang version 1.17 by extracting a tarball to /usr/local and updating the PATH environment variable. Ensure you have removed any existing Go installations first. ```bash sudo tar -C /usr/local -xzf go1.17.6.linux-amd64.tar.gz ``` ```bash echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc ``` -------------------------------- ### Command Field Example Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/app-templates/format.md Provides an example of how to specify a custom command to run within the container. If omitted, the default Dockerfile command is used. ```json { "command": "/bin/bash -c \"echo hello\" && exit 777" } ``` -------------------------------- ### Install pnpm package manager Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/linux.md Downloads and installs the pnpm package manager using its official installation script. ```bash curl -fsSL https://get.pnpm.io/install.sh | sh - ``` -------------------------------- ### Example Kubeconfig File Structure Source: https://github.com/portainer/portainer-docs/blob/2.39/user/kubernetes/kubeconfig.md This is an example of a downloaded kubeconfig file. Note that the server URL is set to the Portainer Server instance, not directly to the Kubernetes cluster. Tokens within the file will expire unless configured otherwise. ```yaml apiVersion: v1 clusters: - cluster: insecure-skip-tls-verify: true server: https://my-portainer-server:9443/api/endpoints/1/kubernetes name: portainer-cluster-kubernetes contexts: - context: cluster: portainer-cluster-kubernetes user: portainer-sa-clusteradmin name: portainer-ctx-kubernetes current-context: portainer-ctx-kubernetes kind: Config preferences: {} users: - name: portainer-sa-clusteradmin user: token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` -------------------------------- ### Access Denied Example Source: https://github.com/portainer/portainer-docs/blob/2.39/api/access.md This example shows the response received when a user attempts to access an endpoint without the necessary permissions. The response includes a 'details' and 'message' field indicating the access denial. ```bash http GET https://portainer:9443/api/settings X-API-Key:your_api_key_here ``` -------------------------------- ### Access Denied Example Source: https://github.com/portainer/portainer-docs/blob/2.39/api/access.md This example shows the response when a user attempts to access an endpoint without sufficient permissions, such as accessing `/settings` as a non-administrator. ```APIDOC ## GET /api/settings (Unauthorized Example) ### Description Demonstrates the error response when a user attempts to access a restricted endpoint without the necessary administrator privileges. ### Method GET ### Endpoint /api/settings ### Parameters #### Headers - **X-API-Key** (string) - Required - The access token for authentication. ### Request Example ```bash http GET https://portainer:9443/api/settings X-API-Key:your_api_key_here ``` ### Response #### Error Response (401/403) - **details** (string) - Indicates the type of error, e.g., "Unauthorized". - **message** (string) - Provides a more specific error message, e.g., "Access denied". #### Response Example ```json { "details": "Unauthorized", "message": "Access denied" } ``` ``` -------------------------------- ### Verify Docker installation Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/linux.md Runs a test container to ensure Docker is installed correctly and functioning. ```bash sudo docker run hello-world ``` -------------------------------- ### Edge Agent Deployment Command Example Source: https://github.com/portainer/portainer-docs/blob/2.39/admin/environments/add/swarm/edge.md This is an example of the command used to deploy the Portainer Edge Agent to a Swarm environment. Adjust the volume mount if your Docker volume path is non-standard. ```bash --mount type=bind,src=//var/lib/docker/volumes,dst=/var/lib/docker/volumes \ ``` -------------------------------- ### Portainer Agent Service Status Example Source: https://github.com/portainer/portainer-docs/blob/2.39/admin/environments/add/swarm/agent.md This is an example of the expected output when the Portainer Agent service is running successfully. ```text ID NAME MODE REPLICAS IMAGE PORTS tshb6ee2710s portainer-agent_agent global 1/1 portainer/agent:latest ``` -------------------------------- ### Example Stack Response Source: https://github.com/portainer/portainer-docs/blob/2.39/api/access.md This is an example of the JSON output returned when successfully listing stacks via the Portainer API. It includes details about each stack, such as its ID, name, creation date, and associated Git configuration. ```json [ { "AdditionalFiles": null, "AutoUpdate": null, "CreatedBy": "admin", "CreationDate": 1631852794, "EndpointId": 4, "EntryPoint": "docker-compose.yml", "Env": null, "GitConfig": { "Authentication": null, "ConfigFilePath": "docker-compose.yml", "ConfigHash": "2e71920bf1ee1bbac976d320f8f274411fba3bad", "ReferenceName": "refs/heads/master", "URL": "https://github.com/mygithubaccount/wordpress-stack" }, "Id": 5, "IsComposeFormat": true, "Name": "", "Namespace": "my-namespace", "ProjectPath": "/data/compose/5", "ResourceControl": null, "Status": 1, "SwarmId": "", "Type": 3, "UpdateDate": 0, "UpdatedBy": "" }, ] ``` -------------------------------- ### Install Portainer EE with custom SSL certs (Docker Standalone) Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/ssl.md Use this command to install Portainer Business Edition with your own SSL certificate and key. Ensure certificates are in PEM format and include the full chain. ```bash docker run -d -p 9443:9443 -p 8000:8000 \ --name portainer --restart always \ -v /var/run/docker.sock:/var/run/docker.sock \ -v portainer_data:/data \ -v /path/to/your/certs:/certs \ portainer/portainer-ee:sts \ --sslcert /certs/portainer.crt \ --sslkey /certs/portainer.key ``` -------------------------------- ### Build and Run Project Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/README.md This command builds the project and starts the development server. The Portainer UI will be accessible at https://localhost:9443 and the UI dev server at http://localhost:8999. ```bash make dev ``` -------------------------------- ### Install Portainer with Existing Secret (NodePort) Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/ssl.md Install Portainer using Helm, specifying an existing TLS secret for SSL termination. This example uses the NodePort service type. ```bash helm install -n portainer portainer portainer/portainer --set tls.existingSecret=portainer-tls-secret --set enterpriseEdition.enabled=true ``` ```bash helm install -n portainer portainer portainer/portainer --set tls.existingSecret=portainer-tls-secret ``` -------------------------------- ### POST /stacks/{id}/start Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md Starts a specific stack, optionally associating it with an environment. ```APIDOC ## POST /stacks/{id}/start ### Description Starts a specific stack, optionally associating it with an environment. ### Method POST ### Endpoint /stacks/{id}/start ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the stack. #### Query Parameters - **endpointId** (string) - Optional - Environment identifier. ``` -------------------------------- ### Configure Portainer to stream logs to SIEM Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/siem.md Use this Docker run command to start Portainer with SIEM log streaming enabled. Ensure the flags are specified after the image name. This example streams logs to `syslog.mydomain.com` on UDP port `514` and sets a custom source hostname. ```bash docker run -d -p 8000:8000 -p 9443:9443 \ --name portainer \ --restart=always \ -v /var/run/docker.sock:/var/run/docker.sock \ -v portainer_data:/data \ portainer/portainer-ee:sts \ --syslog-address=syslog.mydomain.com \ --syslog-port=514 \ --syslog-source-hostname="my-portainer-instance" ``` -------------------------------- ### Verify pnpm installation Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/linux.md Checks the installed version of pnpm to confirm a successful installation. ```bash pnpm --version ``` -------------------------------- ### Start Portainer with password file (EE) Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/cli.md Run the Business Edition of Portainer using a file containing the admin password with the `--admin-password-file` flag. ```bash docker run -d -p 9443:9443 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/portainer_password:/tmp/portainer_password portainer/portainer-ee:sts --admin-password-file /tmp/portainer_password ``` -------------------------------- ### Start Portainer Container Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/reset-admin.md Start the Portainer container after the password has been reset. ```bash docker start "id-portainer-container" ``` -------------------------------- ### List Stacks Source: https://github.com/portainer/portainer-docs/blob/2.39/api/access.md This example demonstrates how to list all stacks accessible by a user using the `/stacks` endpoint. It requires an `X-API-Key` header for authentication. ```APIDOC ## GET /api/stacks ### Description Retrieves a list of all stacks accessible by the authenticated user. ### Method GET ### Endpoint /api/stacks ### Parameters #### Headers - **X-API-Key** (string) - Required - The access token for authentication. ### Request Example ```bash http GET https://portainer-url:9443/api/stacks X-API-Key:your_api_key_here ``` ### Response #### Success Response (200) - **Array of Stack objects** - A JSON array containing stack details. #### Response Example ```json [ { "AdditionalFiles": null, "AutoUpdate": null, "CreatedBy": "admin", "CreationDate": 1631852794, "EndpointId": 4, "EntryPoint": "docker-compose.yml", "Env": null, "GitConfig": { "Authentication": null, "ConfigFilePath": "docker-compose.yml", "ConfigHash": "2e71920bf1ee1bbac976d320f8f274411fba3bad", "ReferenceName": "refs/heads/master", "URL": "https://github.com/mygithubaccount/wordpress-stack" }, "Id": 5, "IsComposeFormat": true, "Name": "", "Namespace": "my-namespace", "ProjectPath": "/data/compose/5", "ResourceControl": null, "Status": 1, "SwarmId": "", "Type": 3, "UpdateDate": 0, "UpdatedBy": "" } ] ``` ``` -------------------------------- ### Install Node.js Version 22 using NVM Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/mac.md Installs Node.js version 22 using the Node Version Manager (NVM). This is required for building Portainer. Ensure NVM is installed first. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash nvm install 22 node --version ``` -------------------------------- ### Set up Docker stable repository Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/linux.md Configures the apt package manager to use the stable Docker repository for your Ubuntu version. ```bash sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" ``` -------------------------------- ### Modified: GET /edge_stacks Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /edge_stacks` endpoint for fetching the list of EdgeStacks has been modified. ```APIDOC ## GET /edge_stacks ### Description Fetches a list of EdgeStacks. Modifications may affect the returned fields or filtering options. ### Method GET ### Endpoint `/edge_stacks` ### Response #### Success Response (200) - **edgeStacks** (array) - A list of EdgeStacks. #### Response Example ```json { "edgeStacks": [ { "id": 1, "name": "Edge App Stack" } ] } ``` ``` -------------------------------- ### Modified: GET /edge_jobs Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /edge_jobs` endpoint for fetching EdgeJobs list has been modified. ```APIDOC ## GET /edge_jobs ### Description Fetches a list of EdgeJobs. Modifications may affect the returned fields or filtering options. ### Method GET ### Endpoint `/edge_jobs` ### Response #### Success Response (200) - **edgeJobs** (array) - A list of EdgeJobs. #### Response Example ```json { "edgeJobs": [ { "id": 1, "name": "Deploy Update" } ] } ``` ``` -------------------------------- ### View Available Commands Source: https://github.com/portainer/portainer-docs/blob/2.39/contribute/build/README.md Run this command to see a list of all available make commands for the Portainer project. ```bash make help ``` -------------------------------- ### Modified: GET /edge_groups Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /edge_groups` endpoint for listing Edge Groups has been modified. ```APIDOC ## GET /edge_groups ### Description Lists Edge Groups. Modifications may affect the returned fields or filtering options. ### Method GET ### Endpoint `/edge_groups` ### Response #### Success Response (200) - **edgeGroups** (array) - A list of Edge Groups. #### Response Example ```json { "edgeGroups": [ { "id": 1, "name": "Production Group" } ] } ``` ``` -------------------------------- ### Modified: GET /edge_configurations Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /edge_configurations` endpoint for listing Edge Configurations has been modified. ```APIDOC ## GET /edge_configurations ### Description Lists available Edge Configurations. Modifications may affect the returned fields or filtering options. ### Method GET ### Endpoint `/edge_configurations` ### Response #### Success Response (200) - **edgeConfigurations** (array) - A list of Edge Configurations. #### Response Example ```json { "edgeConfigurations": [ { "id": 1, "name": "Default Config" } ] } ``` ``` -------------------------------- ### Deploy Portainer Business Edition with Podman Source: https://github.com/portainer/portainer-docs/blob/2.39/start/upgrade/tobe/podman.md Run this command to deploy the latest version of Portainer Business Edition. Ensure you have your license key ready for the initial login. ```bash podman run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name=portainer --restart=always --pull=always --privileged -v /run/podman/podman.sock:/run/podman/podman.sock -v portainer_data:/data portainer/portainer-ee:sts ``` -------------------------------- ### Modified: GET /custom_templates Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /custom_templates` endpoint for listing custom templates has been modified. ```APIDOC ## GET /custom_templates ### Description Lists available custom templates. Modifications may affect the returned fields or filtering options. ### Method GET ### Endpoint `/custom_templates` ### Response #### Success Response (200) - **customTemplates** (array) - A list of custom templates. #### Response Example ```json { "customTemplates": [ { "id": 1, "name": "My Web App Template" } ] } ``` ``` -------------------------------- ### Start Portainer with admin password (EE) Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/cli.md Run the Business Edition of Portainer with a pre-generated bcrypt admin password using the `--admin-password` flag. ```bash docker run -d -p 9443:9443 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer-ee:sts --admin-password='$2y$05$8oz75U8m5tI/xT4P0NbSHeE7WyRzOWKRBprfGotwDkhBOGP/u802u' ``` -------------------------------- ### Start Portainer with password file (CE) Source: https://github.com/portainer/portainer-docs/blob/2.39/advanced/cli.md Run the Community Edition of Portainer using a file containing the admin password with the `--admin-password-file` flag. ```bash docker run -d -p 9443:9443 -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/portainer_password:/tmp/portainer_password portainer/portainer-ce:sts --admin-password-file /tmp/portainer_password ``` -------------------------------- ### Modified: GET /edge_jobs/{id} Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /edge_jobs/{id}` endpoint for inspecting an EdgeJob has been modified. ```APIDOC ## GET /edge_jobs/{id} ### Description Inspects a specific EdgeJob. ### Method GET ### Endpoint `/edge_jobs/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the EdgeJob to inspect. ### Response #### Success Response (200) - **id** (integer) - The EdgeJob ID. - **name** (string) - The EdgeJob name. - **script** (string) - The script content. #### Response Example ```json { "id": 1, "name": "Deploy Update", "script": "echo 'Hello World'" } ``` ``` -------------------------------- ### Create MicroK8s Directories Source: https://github.com/portainer/portainer-docs/blob/2.39/admin/environments/add/kube-create/microk8s/offline.md Create the necessary directories for storing MicroK8s installation files. Ensure these directories are owned by the SSH user Portainer will use. ```bash mkdir -p $HOME/microk8s mkdir -p $HOME/microk8s/images ``` -------------------------------- ### Retrieve Portainer Container Logs Source: https://github.com/portainer/portainer-docs/blob/2.39/faqs/installing/setup-token.md Use this command to access your Portainer server logs and find the setup token. Replace `` with your Portainer container name or ID. ```bash docker logs ``` ```bash podman logs ``` -------------------------------- ### Modified: GET /edge_configurations/{id} Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /edge_configurations/{id}` endpoint for inspecting an Edge Configuration has been modified. ```APIDOC ## GET /edge_configurations/{id} ### Description Inspects a specific Edge Configuration. ### Method GET ### Endpoint `/edge_configurations/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the Edge Configuration to inspect. ### Response #### Success Response (200) - **id** (integer) - The configuration ID. - **name** (string) - The configuration name. - **agentImage** (string) - The agent image. #### Response Example ```json { "id": 1, "name": "Default Config", "agentImage": "portainer/agent:latest" } ``` ``` -------------------------------- ### Run Portainer Agent with Host Filesystem Mount Source: https://github.com/portainer/portainer-docs/blob/2.39/user/docker/host/setup.md This command demonstrates starting the Portainer Agent on Docker with the host filesystem mounted at `/host`, enabling host management features. Ensure the agent version matches your requirements. ```docker docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes -v /:/host portainer/agent:2.22.0 ``` -------------------------------- ### Modified: GET /custom_templates/{id} Source: https://github.com/portainer/portainer-docs/blob/2.39/release-notes.md The `GET /custom_templates/{id}` endpoint for inspecting a custom template has been modified. ```APIDOC ## GET /custom_templates/{id} ### Description Inspects a specific custom template. ### Method GET ### Endpoint `/custom_templates/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the custom template to inspect. ### Response #### Success Response (200) - **id** (integer) - The template ID. - **name** (string) - The template name. - **content** (string) - The template content. #### Response Example ```json { "id": 1, "name": "My Web App Template", "content": "version: '3'\nservices:\n web:\n image: nginx" } ``` ``` -------------------------------- ### Disable Portainer Setup Token Source: https://github.com/portainer/portainer-docs/blob/2.39/faqs/installing/setup-token.md Disable the setup token requirement entirely for instances on trusted, isolated networks. ```bash --no-setup-token ```