Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Manage Root access on Jelastic Cloud (to execute commands on any container)

Update 08/13/2026

This guide details how to access the root of Jelastic Cloud to execute commands on any of your containers.

 

Introduction

  • Some Jelastic Cloud containers do not have root access by default.
  • It is possible to enable this access on the containers of your choice by installing an add-on.
  • You should also consult this other guide if you are looking for information on installing packages without root access.

 

Allow root access

To do this:

  1. Log in to the dashboard of your Jelastic Cloud.
  2. Click on the Import button in the top menu bar.
  3. Go to the JPS tab.
  4. Copy the following code and paste it into the JPS: tab:

    type: update
    name: Root Access
    targetNodes:
      nodeGroup: '*'
          
    onInstall:
      - cmd[${targetNodes.nodeGroup}]: |-
          TARGET_UID=$(id -u jelastic 2>/dev/null) || TARGET_UID="700"
          getent passwd "${TARGET_UID}" &>/dev/null && TARGET_USER=$(getent passwd "${TARGET_UID}" | cut -d: -f1)  || TARGET_USER="jelastic"
          sed -i "\$a${TARGET_USER}\ ALL=NOPASSWD\:\ ALL" /etc/sudoers; echo ${TARGET_USER}
        user: root
      - setGlobals:
          sudo_user: ${response.out}
    onUninstall:
      cmd[${targetNodes.nodeGroup}]: |-
          sed -i "/${globals.sudo_user}\ ALL=NOPASSWD\:\ ALL/d" /etc/sudoers
      user: root
  5. Click the Import button.
  6. Choose the environment and the node on which root access is required.
  7. Click the Install button.

To then execute commands as root, connect to your application via SSH and enter the command sudo su.


Has this FAQ been helpful?