Run it from the server console without the leading slash, or in chat as a level 3+ operator.
/op has no level argument. The new operator receives the level set by op-permission-level in server.properties at the moment the command runs. Pick the level you want and copy the matching line:
Edit this line in server.properties and restart the server. It only affects players opped after the change; existing entries in ops.json keep their old level.
The highlighted level is what your /op command will grant with the server.properties line on the left.
Running /op itself needs level 3 or the server console. The console always has full permissions, which is how you op the very first admin on a fresh server.
/op makes a player a server operator. The player is written to ops.json on the spot and immediately gains the commands allowed by their permission level, which comes from the op-permission-level setting in server.properties (4 by default). Running it requires permission level 3, so the first op on any server has to come from the console.
Operator status is the staff switch on a Java Edition server. A regular player can only chat, build and use a handful of informational commands; an operator can run /gamemode, /give, /tp and the rest of the cheat command set, edit command blocks, bypass the whitelist, and join even when the server is full of higher-priority traffic. /op flips that switch for one player, with no plugin, no restart and no config edit.
Under the hood, operators live in ops.json in the server folder. Each entry stores the player's name, UUID, a level from 1 to 4, and a bypassesPlayerLimit flag. /op creates that entry using the current op-permission-level value and sets bypassesPlayerLimit to false. The file is only read at startup, so the command is the live way to grant access; hand-editing ops.json needs a restart to take effect.
The command takes exactly one argument, and the syntax has been the same in every version of Java Edition:
Copy any of these into the server console (drop the leading slash there) or into chat as a level 3+ operator:
Makes the player named Steve a server operator. Works from the console even while Steve is offline.
Ops the nearest player. From the console this resolves to the player closest to the world spawn.
Ops every online player carrying the staff tag. Assign the tag first with /tag <player> add staff.
Ops every player within 20 blocks of whoever runs the command. The type=player filter is required with @e.
Every operator has a permission level from 1 to 4 stored in their ops.json entry. The level decides which commands they can actually run:
The level a fresh /op grants is controlled by one line in server.properties: op-permission-level=4. Because the default is 4, most servers hand every operator the full command set, /stop included. Lowering it to 2 or 3 before you op anyone is the easiest way to have trusted helpers who cannot ban players or shut the server down. The setting is read when /op runs, so changing it later only affects new ops; existing ops.json entries keep the level they were given. To adjust one player individually, edit the level value in their ops.json entry and restart the server.
1. Decide the level first. If you do not want every op to have /stop and /ban, set op-permission-level in server.properties and restart before granting anything. The tool above gives you the exact line.
2. Open the server console, or join on an account that already has op level 3 or higher. On a brand new server the console is your only option.
3. Run op <playername> in the console, or /op <playername> in chat. The generator above builds the exact line for you, including selector targets.
4. Check the response. "Made <player> a server operator" means it worked; "Nothing changed" means that name already had an entry in ops.json.
5. If you ever need to take the access back, /deop with the same name removes the entry just as instantly.
Run /op followed by the player's name, for example /op Steve. In the server console you type it without the leading slash: op Steve. The player is added to ops.json immediately and can use operator commands without relogging. Running /op from in-game chat requires you to already be a level 3 or 4 operator yourself.
Use the server console, because on a fresh server nobody has permission to run /op from chat. Open the console window or panel where the server is running and type op YourName without a slash. The console always has full permissions, so this works even when ops.json is empty.
Level 1 lets an operator build inside spawn protection but adds no commands. Level 2 unlocks cheat commands like /gamemode, /give, /tp and command block editing. Level 3 adds player management: /op, /deop, /kick, /ban and /whitelist. Level 4 unlocks everything, including server controls like /stop. The level /op grants is set by op-permission-level in server.properties and defaults to 4.
Edit the op-permission-level line in server.properties and restart the server; every /op after that grants the new level. To give one specific operator a different level, op them first, then change the level value in their ops.json entry and restart. The /op command itself never takes a level argument.
Java Edition only has an operator system on multiplayer servers, so /op and /deop do not exist in singleplayer or LAN worlds. The equivalent there is the cheats toggle: enable Allow Cheats when creating the world, or use Open to LAN with cheats on for an existing one. In Bedrock Edition, /op works in any world with cheats enabled.
No. Command blocks execute at permission level 2, while /op requires level 3, so a command block that tries to run it fails with a permissions error. This is deliberate: it stops players from wiring up a command block that ops them. Grant operator status from the console or from a level 3+ operator account instead.
Need to revoke operator status instead? Or browse more Minecraft tools: