How to op yourself in the Minecraft server console
To op yourself in the Minecraft server console, you need 1 line: op followed by your player name, without a slash. The console runs commands with full rights, which matters on a new server, because ops.json starts empty and nobody is an operator yet, not even the person who paid for the server. Take these 4 steps:
- Open the console, in your host's panel or in the window where the server runs.
- Type op and your name exactly as the game spells it, for example
op YourName, and press Enter. - Read the answer.
Made YourName a server operatormeans it worked, andNothing changed. The player is already an operatormeans you were one already. - Test it in the game with a command such as
/gamemode creative, typed in the chat with a slash.
You do not have to rejoin, as the new rights apply the moment the command runs. On Java the player does not even have to be online: op looks the name up, so you can op a friend before their first visit.
Your host's panel may also have a button for it. Astroworld Hosting's panel, for example, has an Operators list on the Players tab with an Add operator button, and it works while the server is off: the panel then looks the player up and writes the file itself, so the rights are there on the next start. Panel staff need the Players right for it, which that panel gives the Moderator role and not the Builder or Viewer role.
Minecraft op levels explained
Minecraft op levels on Java go from 0 to 4, and each level includes everything below it, so a level 3 admin can do all that a level 2 gamemaster can. The level only counts for operators: a player who is not one can use just the basic commands, such as /msg, /list and /help.
| Level | Name | What it adds | Commands it adds |
|---|---|---|---|
| 0 | Operator | Command block output and console messages in the chat, and the TPS graph in the debug screen | None |
| 1 | Moderator | Building and breaking blocks inside spawn protection | None |
| 2 | Gamemaster | Most cheat commands, command blocks, and F3+F4 to switch game mode | gamemode, give, tp, time, weather, gamerule |
| 3 | Admin | Managing players | kick, ban, pardon, whitelist, op, deop |
| 4 | Owner | Managing the server | stop, save-all, save-off, save-on |
Level 2 is what most friends ask for: creative mode, teleporting, and day instead of night. Level 3 is the first that can remove players, and also the first that can run op itself. Bedrock uses levels as well, but there you hand out a role, not a number.
What does op-permission-level=4 mean?
op-permission-level=4 in server.properties means that the op command makes players operators at level 4, the highest, and 4 is the default. The setting takes 0 to 4 and only applies at the moment someone is opped: each operator's level is stored with their name in ops.json, so lowering the setting later leaves your current operators at their old level until you deop and op them again.
Running op takes level 3, but the level it hands out comes from op-permission-level, not from the person who types it. On a server left at 4, a level 3 admin can therefore create a level 4 owner. With more than one operator, set op-permission-level to 2 or 3. You lose little by it yourself, since the console can still stop and save the server whatever your own level is. Our guide to server.properties settings has the other options; function-permission-level, default 2, sets the level of data pack functions and has nothing to do with players.
ops.json format and example
The ops.json format is a JSON list with 1 entry per operator, and this example from a server with a single owner shows the 4 fields of each entry: uuid, name, level and bypassesPlayerLimit.
[
{
"uuid": "<your UUID>",
"name": "YourName",
"level": 4,
"bypassesPlayerLimit": false
}
]The uuid is the account ID that the server matches, which is why an operator keeps their rights after a name change. The level is 0 to 4, and "bypassesPlayerLimit": true lets that operator join when everyone else sees The server is full!, though they still count toward max-players.
Edit ops.json only while the server is stopped. A running server keeps its operators in memory, vanilla has no command to read the file again, and the next op or deop writes the server's own list over your changes. To give someone a level other than the default, op them once so the server fills in the right UUID, stop the server, change their level and start it again.
How to op someone on a Bedrock server
To op someone on a Bedrock server, type op and their gamertag in the console while they are online, because Bedrock's op only finds players who are in the game. Put a gamertag with a space in quotes, as in op "Sam Plays". The server gives the player the operator role and saves it in permissions.json in its main folder, not in the file of the same name under config/default, which is about scripting.
Each entry in permissions.json has 2 fields: xuid, the player's Xbox user ID, and permission, which is visitor, member or operator. It needs online-mode=true, because the XUID comes from the Xbox sign-in. After editing the file, run permission reload in the console, and permission list shows who has which role.
A new Bedrock server also has allow-cheats=false, which blocks commands such as /gamemode and /give even for operators, so set it to true if your operators need them. And an operator on a Bedrock server has permission level 1, while Microsoft's documentation puts op at the Admin level, 2, so the reliable ways to make others operator are the console and the player permissions screen in the game menu. default-player-permission-level decides what new players get, member by default; on a public server, never set it to operator.
How to op someone in Minecraft Realms
To op someone in Minecraft Realms on Java, quit the world to the main menu, open your Realm's configuration and make the player an operator in its list of players. There is no op command, because Java only has it on dedicated servers. Realm operators get level 2, enough for creative and teleporting but not for kick or ban, and during a minigame everyone, the owner included, is at level 0. The owner's own operator status cannot be taken away.
On a Bedrock Realm, the owner or an operator sets a member to Operator in Manage Members, in the player permissions screen of the game menu, or in the Realm settings on minecraft.net, which also works while that member is offline. A Bedrock Realm operator has level 1. A Java Realm cannot run plugins or mods, so a rank plugin is not an option there; our page on the Minecraft Realms alternative compares servers that can.
How to op someone in a LAN world
To op someone in a LAN world on Java, you allow commands for the players who join, since op only exists on dedicated servers. In Minecraft 26.3 that is Command Access under Multiplayer in World Options, which took the place of the Open to LAN button in the game menu; on older versions it is the Allow Commands switch on the Open to LAN screen. Since 26.2 that switch no longer covers the host, whose own commands come from the world's Allow Commands setting.
On Bedrock, the host opens the player permissions screen in the game menu and sets the player to Operator, which gives them level 2, while the host has level 3. Setting any other player to Operator switches off achievements in that world for good.
How to deop someone in Minecraft
To deop someone in Minecraft, type deop and their name in the console, or /deop with the name in the chat at level 3 or higher, and the server answers Made Name no longer a server operator. They stay in the game but lose every command beyond the basic ones at once. Nothing changed. The player is not an operator means there was nothing to remove.
On Java, deop does not compare levels, so any operator at level 3 can deop a level 4 owner. You can deop yourself too, for example to play survival without the temptation, and as long as you have the console you can always op yourself again. On Bedrock, deop turns the player back into a member at level 0. To take someone out of ops.json by hand, stop the server and delete their whole entry, from { to }, with the comma that joined it to its neighbour, or the file stops being valid JSON.
Minecraft op command not working
When the Minecraft op command is not working, the cause is usually one of these 7, and the message you see points to which one:
| What you see | Why | Fix |
|---|---|---|
| Unknown or incomplete command. See below for error | You are not an operator, or your level is too low for that command | Op yourself in the console, or raise your level in ops.json |
| That player does not exist | A typo, or no Java account has that name | Copy the name exactly; on a crossplay server, Bedrock names start with a prefix, a period by default |
| Nothing changed. The player is already an operator | They are an operator already, at some level | Change their level in ops.json while the server is stopped |
| Your change to ops.json is gone | The server was running and saved its own list over it | Stop the server before you edit the file |
| Friends can no longer build near spawn | Spawn protection only starts working once the server has an operator | Set spawn-protection=0, or build outside the protected square |
| op and deop are switched off | LuckPerms runs with auto-op: true or enable-ops: false | Give the permission luckperms.autoop instead, or change the setting back |
| Bedrock: /gamemode or /give does nothing | The server has allow-cheats=false | Set allow-cheats=true and restart |
An operator on Java gets past the whitelist, so when an operator cannot join at all, look at the connection first. Our guide on why you can't connect to a Minecraft server goes through it step by step.
How to make someone a moderator on a Minecraft server
To make someone a moderator on a Minecraft server, give them a rank in a permissions plugin instead of op, so they get the 2 or 3 commands they need and not the rest. LuckPerms is a common choice: version 5.5.87, from October 2026, runs on Paper, Fabric, Forge, NeoForge and Sponge, and on Velocity and BungeeCord proxies. On a Paper server, these 4 lines in the console create a mod rank that can kick and ban, and put a player called Alex in it:
lp creategroup mod
lp group mod permission set minecraft.command.kick true
lp group mod permission set minecraft.command.ban true
lp user Alex parent add modAdd the commands of your other plugins to the same group in the same way. When a plugin's docs do not say which permission a command needs, /lp verbose record with the moderator's name logs the checks while they try it. On Paper, many plugins also let operators use all of their commands, which is one more reason to keep op for yourself.
LuckPerms has a middle way as well. With auto-op: true in its config, everyone with the permission luckperms.autoop becomes an operator when they join or change worlds, and the op and deop commands are switched off. Taking the permission away only counts from their next join or change of world, and LuckPerms recommends this setup over giving someone the * permission, which grants everything every plugin has.

