Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

imrelaur's avatar

Sudo command not found

Hello I have an issue when I try to deploy my project with Envoyer.

Our host server has no sudo command and I cannot install it with apt-get since that too does not exist.

Error says: "bash: line 20: sudo: command not found".

I contacted my host server support and they said none of their services has this kind of command supported. So is there somekind of work around to get past this sudo command not found error?

0 likes
11 replies
tykus's avatar
tykus
Best Answer
Level 104

Use a different hosting service.

AddWebContribution's avatar

By default sudo is not installed on Debian, but you can install it. First enable su-mode: su -

Install sudo by running:

apt-get install sudo -y

After that you would need to play around with users and permissions. Give sudo right to your own user.

usermod -aG sudo yourusername

Make sure your sudoers file have sudo group added. Run: visudo to modify sudoers file and add following line into it (if it is missing):

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

You need to relogin or reboot device completely for changes to take effect.

imrelaur's avatar

@tykus Not the answer I was looking for. Since now it is not an option.

@saurabhd I said I do not have apt-get command available either.

Cruorzy's avatar

Are you currently logged in as a normal user or as root? Which dist of linux is it?

imrelaur's avatar

@Cruorzy I assume normal user. I noticed that there is an alias for su. When I try to call it it says permission denied. We use dedicated server, if that helps.

Cruorzy's avatar

@imre08 when you reply try to tag the user.

Also the hardware doesn't matter, in my experience when you hire a dedicated server you should have access to the root user to indeed install 'sudo' and configure it if you like to.

If you don't have access to the root user you are way to limited and i'll also suggest moving, because you are simply restricted from doing almost anything.

So ask how you can find the root credentials.

1 like
tykus's avatar

@tykus Not the answer I was looking for. Since now it is not an option.

Perhaps not, but it doesn't seem that the current solution gives you the degree of control that you want. Sometimes, we just have to accept that and move on.

imrelaur's avatar

@tykus and @Cruorzy If you are suggesting to change service provider, then what are your recommendations. Note that I have basic knowledge of managing servers. I looked into AWS and for me it seemed pretty complicated.

tykus's avatar

Digital Ocean through Forge is reasonably intuitive.

imrelaur's avatar

I guess if there is no other way I will accept @tykus first answer.

imrelaur's avatar

@tykus I think I found another workaround, uncheck 'Restart FPM After Deployments'. That made Envoyer deployment hooks pass. Why would I need to restart fpm?

Please or to participate in this conversation.