[How-To] Use "screen" on your Linux Minecraft Server
So you've got your new hosted server or you're running Linux on a spare machine.. awesome! Linux is a great OS and really fun to learn given that you have the patience for it. So you're either using the Terminal or you've logged into your server using PuTTy and you keep running into a little problem... your server quits every time you close the terminal or PuTTy!
Well thankfully there's an easy fix to this.. it's a nifty little program called "screen". What screen does is essentially give you a second terminal "window" in which you can execute commands and start applications within. If you've ever wondered how to close your Terminal/PuTTY window/connection and keep your server running, this is it! So let's get started.
[Step 1] Installing Screen
Depending on your version of Linux (Ubuntu, Debian, CentOS, etc) installing screen relies on a package manager/installer. You'll either use "apt" or "yum". If you know which one your distro uses, choose that command from the following. If you don't, you're free to try both, it wont hurt anything and only one will work.
Login to your server as "root" if available, if you do not have root access to your server then this may not work and you'll have to ask your host to provide you with instructions. If you are logged in as a username other than root you can always prefix any of these commands with "sudo" or "su".
apt
apt-get install screen (hit enter)
yum
yum install screen (hit enter)
[Step 2] Using Screen
Once the installation is finished, you're ready to use screen. Using screen is just as easy as installing it.. all you have to do is type one command.
screen (hit enter)
Now you should see a fresh terminal screen and you're ready to perform your commands to start your server. Once you've got your Minecraft server running and you see the games console on your screen, you're done! Now there are just a couple extra commands to remember to control your new toy.
Exiting (detaching) from your Minecraft console's screen
So you've started your server and you're staring at the console, ready to exit and work on something else or play the game?
To detach the screen you're currently viewing you'll do this:
hold down CONTROL and hit A and then D
You should now see (detached) and your original Terminal/PuTTy screen.. congrats, you're almost done!
Resuming a running screen
So you've detached your screen, your server is still running and you've closed PuTTy/Terminal and played the game for a couple hours.. but you need to restart your server.. how? Log back into your server and type:
screen -r
If you only have one screen running, you'll be instantly transferred to that one screen. If you happen to have opened more than one in your travels, you'll be presented with a list of open screens that looks similar to this:
There are several suitable screens on:
6962.ttys000.computername (Detached)
6966.ttys000.computername (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
If you're presented with this list, you'll want to use the "PID" number at the beginning of the screen you want to resume, in the above examples the PIDs are 6962 and 6966. To resume one of the screens you'd use the following format:
screen -r 6962
</end>
If you have any questions, feel free to ask but I've covered just about everything here so good luck and enjoy your new found knowledge. :smile.gif:
https://allgamer.net/ - Minecraft, KVM VPS, and Dedicated Server Hosting
Email/MSN: clinton -at- allgamer -dot- net
AIM: Clinton4664 | Skype: clinton_collins I am a representative of AllGamer
Thanks guys. :smile.gif: Saw a few people asking questions about it over the last day or so.. so I figured it wouldn't hurt to take a few minutes and write something up.
but can't i get the "screen" when i have shutdown the puttywindow?! because i can't right now... that sucks.
No, if you've closed PuTTy then you've closed the connection to the server itself. If you want to watch the server console, just keep the screen attached and don't close PuTTy.
OK thanks for the help but acctualy that sucks. I want to access the server from multiple consoles... may there be a solution to that?
Oh you want to watch the console from two computers? Is that what you're saying?
In order to do that you have to turn the multiuser setting on in screen.
To turn on multi-user, follow these instructions:
1: While attached to the current screen, hold CONTROL and hit A
2: Type the following immediately after hitting A
:multiuser on
3: Hit enter after typing the above code
If you've done it properly, you should see this message "Multiuser mode enabled" - Now you can login to your server through PuTTy on a second machine and type
screen -x
You should now have the screen attached on both PuTTy sessions.
OK thanks for the help but acctualy that sucks. I want to access the server from multiple consoles... may there be a solution to that?
Oh you want to watch the console from two computers? Is that what you're saying?
In order to do that you have to turn the multiuser setting on in screen.
To turn on multi-user, follow these instructions:
1: While attached to the current screen, hold CONTROL and hit A
2: Type the following immediately after hitting A
:multiuser on
3: Hit enter after typing the above code
If you've done it properly, you should see this message "Multiuser mode enabled" - Now you can login to your server through PuTTy on a second machine and type
screen -x
You should now have the screen attached on both PuTTy sessions.
If there was someone to thank for people like you!!!! thank you now my problems are solved :biggrin.gif:
ehh i have a problem i cant use commands after i am in the "screen" of minecraft server (running minecraft server 1.6.5 with industrialcraft mod) Please help me
Rollback Post to RevisionRollBack
“Life isn't worth living, unless it is lived for someone else.”
― Albert Einstein
So you've got your new hosted server or you're running Linux on a spare machine.. awesome! Linux is a great OS and really fun to learn given that you have the patience for it. So you're either using the Terminal or you've logged into your server using PuTTy and you keep running into a little problem... your server quits every time you close the terminal or PuTTy!
Well thankfully there's an easy fix to this.. it's a nifty little program called "screen". What screen does is essentially give you a second terminal "window" in which you can execute commands and start applications within. If you've ever wondered how to close your Terminal/PuTTY window/connection and keep your server running, this is it! So let's get started.
[Step 1] Installing Screen
Depending on your version of Linux (Ubuntu, Debian, CentOS, etc) installing screen relies on a package manager/installer. You'll either use "apt" or "yum". If you know which one your distro uses, choose that command from the following. If you don't, you're free to try both, it wont hurt anything and only one will work.
Login to your server as "root" if available, if you do not have root access to your server then this may not work and you'll have to ask your host to provide you with instructions. If you are logged in as a username other than root you can always prefix any of these commands with "sudo" or "su".
apt
yum
[Step 2] Using Screen
Once the installation is finished, you're ready to use screen. Using screen is just as easy as installing it.. all you have to do is type one command.
Now you should see a fresh terminal screen and you're ready to perform your commands to start your server. Once you've got your Minecraft server running and you see the games console on your screen, you're done! Now there are just a couple extra commands to remember to control your new toy.
Exiting (detaching) from your Minecraft console's screen
So you've started your server and you're staring at the console, ready to exit and work on something else or play the game?
To detach the screen you're currently viewing you'll do this:
You should now see (detached) and your original Terminal/PuTTy screen.. congrats, you're almost done!
Resuming a running screen
So you've detached your screen, your server is still running and you've closed PuTTy/Terminal and played the game for a couple hours.. but you need to restart your server.. how? Log back into your server and type:
If you only have one screen running, you'll be instantly transferred to that one screen. If you happen to have opened more than one in your travels, you'll be presented with a list of open screens that looks similar to this:
If you're presented with this list, you'll want to use the "PID" number at the beginning of the screen you want to resume, in the above examples the PIDs are 6962 and 6966. To resume one of the screens you'd use the following format:
</end>
If you have any questions, feel free to ask but I've covered just about everything here so good luck and enjoy your new found knowledge. :smile.gif:
w: minecraft.cm | e: [email protected] | t: @minecraft_cm | reviews
https://allgamer.net/ - Minecraft, KVM VPS, and Dedicated Server Hosting
Email/MSN: clinton -at- allgamer -dot- net
AIM: Clinton4664 | Skype: clinton_collins
I am a representative of AllGamer
Trusted and Established Minecraft Server Hosting since Alpha in 2010. Minecraft Server Host: www.minecraftserverhost.net
Test Servers: test.minecraft.ms | east.minecraft.ms | central.minecraft.ms | west.minecraft.ms
I am a representative of Minecraftserverhost.net
w: minecraft.cm | e: [email protected] | t: @minecraft_cm | reviews
No, if you've closed PuTTy then you've closed the connection to the server itself. If you want to watch the server console, just keep the screen attached and don't close PuTTy.
w: minecraft.cm | e: [email protected] | t: @minecraft_cm | reviews
Hosted by Jmainguy
Oh you want to watch the console from two computers? Is that what you're saying?
In order to do that you have to turn the multiuser setting on in screen.
To turn on multi-user, follow these instructions:
1: While attached to the current screen, hold CONTROL and hit A
2: Type the following immediately after hitting A
3: Hit enter after typing the above code
If you've done it properly, you should see this message "Multiuser mode enabled" - Now you can login to your server through PuTTy on a second machine and type
You should now have the screen attached on both PuTTy sessions.
w: minecraft.cm | e: [email protected] | t: @minecraft_cm | reviews
If there was someone to thank for people like you!!!! thank you now my problems are solved :biggrin.gif:
― Albert Einstein