Date
Dec. 22nd, 2024
 
2024年 11月 22日

Post: Keep Django server running after close ssh session

Keep Django server running after close ssh session

Published 12:01 Jan 02, 2021.

Created by @ezra. Categorized in #Programming, and tagged as #Python, #UNIX/Linux.

Source format: Markdown

Table of Content

Meet screen

Connect through ssh, start screen. This open a virtual console emulator on top of the one provided by ssh. Start your server there.

Then press Ctrl-a, then d. This detaches the screen session, keeping it running in the background.

Quit screens

killall screen
screen -list
screen -S SCREEN_SESSION_ID -X quit

Django runserver in screen

screen -d -m python3 path/to/manage.py runserver 0.0.0.0:80
Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
开发、设计与写作皆为所长。
热爱苹果、钟情色彩。
随时恭候 垂询