How to make yourself OP on a Minecraft server
Operator is the built in admin flag. Granting it takes one command, and the part worth knowing is which of the four levels you are handing over and why you should hand it over rarely.
From the server console
The console is always operator level 4, so this works even on a brand new server where nobody has any permissions yet. With the server running, type into the console window:
op YourUsernameNo slash. The console does not use them. If you are on a host with a web panel, the console tab there is the same thing. To remove it again, deop YourUsername.
The username has to match exactly, including capitals, and the player must have joined at least once on an online-mode server so it can resolve the account to a UUID.
In game, once you already have it
An existing operator can promote someone else with the same command and a slash:
/op TheirUsernameThis is why operator is dangerous to hand out. Anyone with it can give it to anyone else, and can take it from you. There is no audit trail beyond the server log.
Editing ops.json directly
When the server is stopped you can edit ops.json in the server folder. It is a list of objects, one per operator:
[
{
"uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
"name": "Notch",
"level": 4,
"bypassesPlayerLimit": false
}
]Edit it while the server is stopped. A running server rewrites the file from memory when it shuts down and your change disappears. The UUID has to be the real one for that account, so this route is mostly useful for restoring access you locked yourself out of.
The four levels
Level 1 bypasses spawn protection. Level 2 adds the cheat commands and the ability to use command blocks. Level 3 adds player management, so kick, ban and whitelist. Level 4 adds /stop and the rest of the server control commands.
The default for /op is whatever op-permission-level in server.properties says, which ships as 4. Lowering it to 3 means a routine operator cannot stop the server, which is a small but real improvement. Our server.properties reference lists the setting.
Why most servers should not use it
Operator was designed for a server run by one person for their friends. It has no granularity, no expiry, and no way to give someone a single ability. The moment you have staff roles, a permissions plugin is the right answer and operator should sit unused on one account.
Our permissions guide covers setting that up. The short version: install LuckPerms, build a group ladder, deop everyone including yourself.