13

I tried using sudo to run a command on Heroku. Then I get a message that I cannot use the sudo command on Heroku. My real question is: How can I run a command with root privilege on Heroku, because it is required for some of the commands I'm trying to run?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

9

You cannot run as root on a Heroku Dyno, as Dynos are effectively containers, isolated from the host system. However, you should be able to install most packages via Buildpacks, either via first party supported buildpacks, thirdparty buildpacks, or via heroku-buildpack-apt. Attempting to alter any system files, will likely either not work, or will have unintended consequences.

maniacalrobot
  • 2,413
  • 2
  • 18
  • 20
  • I understand that build packs are to be used to install packages in heroku. I used the heroku-buildpack-apt to install a `.deb` package. Now how do I install it? – Adarsh TS Jul 24 '21 at 07:43