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
- 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.
- Type the command below, replacing
YourNamewith your exact Minecraft username. Capital letters count, and the console takes commands without a slash. - Join the server. If you were already online, leave and join again so the change takes effect.
- Test it in game with a command that needs OP, such as
/gamemode creative.
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.
[
{
"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.
| Level | Name | What it adds |
|---|---|---|
| 1 | Moderator | Bypass spawn protection. |
| 2 | Gamemaster | More commands and command blocks. |
| 3 | Admin | Commands for managing players, including /op. |
| 4 | Owner | All 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:
| Command | What it does |
|---|---|
whitelist on | Turns the whitelist on. |
whitelist add PlayerName | Adds a player. They do not need to be online. |
whitelist remove PlayerName | Removes a player. |
whitelist list | Shows everyone on the list. |
whitelist reload | Reloads whitelist.json after you edit it by hand. |
whitelist off | Turns 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.
| Command | What it does |
|---|---|
gamemode creative PlayerName | Changes a player’s game mode. Use survival to switch back. |
tp PlayerName1 PlayerName2 | Teleports the first player to the second. |
time set day | Sets the time of day to morning. |
weather clear | Stops rain and storms. |
kick PlayerName | Removes a player from the server. They can rejoin unless you ban them. |
say Message | Sends 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
- You are OP, and no one else is, unless you trust them.
- The whitelist is on and every friend is on the list.
online-modeis stilltrue, unless the server sits behind a proxy that you configured.- 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.jsonorwhitelist.jsonbut nothing changed. Runwhitelist reloadfor 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
Minecraft Java hostingPaper, Purpur, Fabric, Forge and more
Minecraft Bedrock hostingPhones, consoles and Windows
Written by TheGameHosting Team, the people who run our servers in Dallas and Amsterdam and answer your tickets.
All posts
TheGameHosting Team