Install Portainer CE on your Kubernetes environment
Last updated
Was this helpful?
Last updated
Was this helpful?
Portainer consists of two elements, the Portainer Server and the Portainer Agent. Both elements run as lightweight containers on Kubernetes.
To get started, you will need:
A working and up to date Kubernetes cluster.
Access to run helm
or kubectl
commands on your cluster.
Cluster Admin rights on your Kubernetes cluster. This is so Portainer can create the necessary ServiceAccount
and ClusterRoleBinding
for it to access the Kubernetes cluster.
A default
StorageClass configured (see below).
The installation instructions also make the following assumptions about your environment:
Your environment meets . While Portainer may work with other configurations, it may require configuration changes or have limited functionality.
Kubernetes RBAC is enabled and working (this is required for the access control functionality in Portainer).
You will be using the portainer
namespace for Portainer. At present this is a requirement - other namespaces are currently unsupported.
Kubernetes' metrics server is installed and working (if you wish to use the metrics within Portainer).
Portainer requires data persistence, and as a result needs at least one StorageClass available to use. Portainer will attempt to use the default StorageClass during deployment. If you do not have a StorageClass tagged as default
the deployment will likely fail.
You can check if you have a default StorageClass by running the following command on your cluster:
and looking for a StorageClass with (default)
after its name:
To set a StorageClass as default, you can use the following:
replacing <storage-class-name>
with the name of your StorageClass. Alternatively, if you are installing using our Helm chart, you can pass the following parameter in your helm install command to specify the StorageClass to use for Portainer:
To deploy Portainer within a Kubernetes cluster you can use our provided Helm charts or YAML manifests.
First add the Portainer Helm repository by running the following commands:
Once the update completes, you're ready to begin the installation. Which method you choose will depend on how you wish to expose the Portainer service:
Using the following command, Portainer will be available on port 30779
for HTTPS:
Our YAML manifests support exposing Portainer via either NodePort or Load Balancer.
To expose via NodePort, you can use the following command (Portainer will be available on port 30777
for HTTP and 30779
for HTTPS):
Now that the installation is complete, you can log into your Portainer Server instance. Depending on how you chose to expose your Portainer installation, open a web browser and navigate to the following URL:
Replace localhost
with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier.
You will be presented with the initial setup page for Portainer Server.
By default, Portainer generates and uses a self-signed SSL certificate to secure port 30779
. Alternatively you can provide your own SSL certificate or after installation is complete.
In this example, Portainer will be deployed to your cluster and assigned a Cluster IP, with an nginx Ingress Controller at the defined hostname. For more on Ingress options, refer to the list of .
By default, Portainer generates and uses a self-signed SSL certificate to secure port 9443
. Alternatively you can provide your own SSL certificate or after installation is complete.
By default, Portainer generates and uses a self-signed SSL certificate to secure port 30779
. Alternatively you can provide your own SSL certificate or after installation is complete.
By default, Portainer generates and uses a self-signed SSL certificate to secure port 9443
. Alternatively you can provide your own SSL certificate or after installation is complete.