Minecraft

How to OP Yourself on a Minecraft Server (and Whitelist)

One console command makes you the operator. Then turn on the whitelist, add your friends and give each helper only the permissions they need.

TheGameHosting Team 5 min read
Minecraft character with a diamond sword and a bow on a green background
Operators can run commands that regular players cannot. Give the role only to people you trust.

To OP yourself on a Minecraft Java server, open the server console and type op YourName, using your exact Minecraft username and no slash. To restrict who can join, type whitelist on, then whitelist add FriendName for each player. Both commands work from the TheGameHosting panel’s Console tab.

The console is the place to start because the /op command needs permission level 3, which a new player does not have. Below you will find the commands, what each permission level allows and how to fix the usual whitelist problems.

How to OP yourself from the console

  1. Open your server in the panel and choose Console. If you run the server on your own computer, use the terminal window where the server is running.
  2. Type the command below, replacing YourName with your exact Minecraft username. Capital letters count, and the console takes commands without a slash.
  3. Join the server. If you were already online, leave and join again so the change takes effect.
  4. Test it in game with a command that needs OP, such as /gamemode creative.
Server console
op YourName

The command adds your username and UUID to ops.json in the server folder. Open it in the Files tab if you want to check, or to add an operator by hand. The Minecraft Wiki notes that editing the file directly requires the player to rejoin.

ops.json
[
  {
    "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
    "name": "Notch",
    "level": 4,
    "bypassesPlayerLimit": false
  }
]

Your operator status follows your UUID, so it survives a username change. The exception is a server with online-mode=false, where the UUID is generated from the name.

What each permission level can do

The default level of an operator is set by op-permission-level in server.properties, and its default is 4. You can give a player a lower level in ops.json. Levels are cumulative: each one allows everything the lower ones allow. This table summarises the Minecraft Wiki.

LevelNameWhat it adds
1ModeratorBypass spawn protection.
2GamemasterMore commands and command blocks.
3AdminCommands for managing players, including /op.
4OwnerAll commands, including those that manage the server, such as stop.

For a helper who only needs to watch the chat and the spawn, level 1 or 2 is plenty. Keep level 4 for yourself.

How to whitelist players

A whitelist lets only the players on a list join. The Minecraft Wiki recommends it for any server that other people can reach, because it keeps strangers from joining and griefing without notice. Use these console commands:

CommandWhat it does
whitelist onTurns the whitelist on.
whitelist add PlayerNameAdds a player. They do not need to be online.
whitelist remove PlayerNameRemoves a player.
whitelist listShows everyone on the list.
whitelist reloadReloads whitelist.json after you edit it by hand.
whitelist offTurns the whitelist off.

You can also turn it on permanently with white-list=true in server.properties. Setting enforce-whitelist=true as well kicks online players who are not on the list after the list reloads. The list itself is stored in whitelist.json.

Commands to try as an operator

Once you have OP, these are the commands most owners use in the first hour. Type them in game chat with a slash, or in the console without one.

CommandWhat it does
gamemode creative PlayerNameChanges a player’s game mode. Use survival to switch back.
tp PlayerName1 PlayerName2Teleports the first player to the second.
time set daySets the time of day to morning.
weather clearStops rain and storms.
kick PlayerNameRemoves a player from the server. They can rejoin unless you ban them.
say MessageSends a message to everyone online.

Which of these a helper can run depends on their permission level, so a level 2 moderator may be able to teleport players while a level 1 moderator cannot.

Checklist before you share the address

  1. You are OP, and no one else is, unless you trust them.
  2. The whitelist is on and every friend is on the list.
  3. online-mode is still true, unless the server sits behind a proxy that you configured.
  4. You have a backup. In our panel, open Backups and create one before you give anyone admin rights.

Fix the common problems

  • “You are not white-listed on this server!” The player is missing from whitelist list, or the name was typed with a mistake. Add it again with the exact spelling.
  • The command does nothing in the panel console. Remove the leading slash. In the console you type op YourName, while in game chat you type /op YourName.
  • You edited ops.json or whitelist.json but nothing changed. Run whitelist reload for the whitelist, and rejoin for ops.
  • A friend cannot reach the server at all. That is a connection problem, not a whitelist problem. Follow our connection timed out guide.

Beyond OP: control permissions with a plugin

OP is all or nothing. When you have moderators, builders and regular players, a permissions plugin lets you decide who can use which command. PaperMC’s own guide points to LuckPerms for this. You can install it from the Plugin Installer, as shown in how to install plugins on a Paper server.

If you have not built the server yet, start with how to make a Minecraft Java server. Whitelist and permissions are the first two things worth setting up before you share the address.

FAQ

Can I OP myself from inside the game?

Only if you already have operator status. The /op command needs permission level 3, so the first operator has to run it from the server console. On a hosted server that is the Console tab in the panel.

Do operators need to be on the whitelist?

Not on Java Edition. According to the Minecraft Wiki, server operators can always connect while the whitelist is on, even when their profile is not listed. Add yourself anyway if you may remove your own OP later.

How do I remove OP from a player?

Type deop PlayerName in the console. That removes the player from ops.json. To lower their level instead, edit the level value of that player in ops.json and restart the server.

Does OP give me creative mode?

No. OP gives you the right to run commands, including /gamemode, but it does not change your game mode by itself. Which commands you can run depends on your permission level.

Is it safe to OP my friends?

Only OP people you fully trust. The Minecraft Wiki warns that operators can stop the server, change game modes, give themselves items and make large changes to the world that can be used for griefing. For most helpers, a permission plugin gives more control than OP does.

Hosting for these games

Written by TheGameHosting Team, the people who run our servers in Dallas and Amsterdam and answer your tickets.

All posts