Sudo: bench: command not found 2025

I am trying to setup Frappe Bench on a fresh server for production.

I have managed to setup most of it following the instructions on this page:
https://docs.frappe.io/framework/user/en/bench/guides/setup-production

But when I give the command:
sudo bench setup production $USER

I am getting the following error:
sudo: bench: command not found

How to solve this issue?

Try sudo su then bench setup production $USER