安裝
YouTube 教學
如果你不是喜歡閱讀文字的人,我們的社群製作了 YouTube 教學影片。
下載已編譯執行檔
你可以從 GitHub 下載最新已編譯的執行檔:下載
從原始碼建置
We recommend you to download our precompiled binary file from GitHub.
However, if you want to build the program from source code, please follow the guide.
Windows
要求:
- Git
- .NET 7.0 or new-er or Visual Studio configured for C# app development
小提示
**If you want to modify the code, and you are new to C# or in programming in general, you might want to watch some C# tutorials, we recommend the ones listed in [Creating Bots](creating-bots.md#requirements) section.**
使用 Git 克隆(Git clone)
安裝 Git
- 新建一個資料夾用作存放原始碼
- 打開資料夾,按住
SHIFT
鍵並在空白地方右鍵
- 點擊
Git Bash Here
- 執行以下指令來克隆 GitHub 儲存庫:
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
- 克隆完成後,你可以關掉
Git Bash
命令列 - 打開新克隆的資料夾
下載翻譯資源(可選)
- 造訪 MCC 在Crowdin上的頁面.
- 您登入 Crowdin後,方能下載。
- 點擊您想要下載的翻譯文件。
- 查詢
MinecraftClient
->的資源
->翻譯於
->MCC in-app text
- 點擊於本行末尾的
•••
。 - 點擊 下載和儲存文件到文件夾中
/MinecraftClient/Resources/Translations/
。 - 查詢
MinecraftClient
->的資源中
->ConfigComments
->程式功能的註解都在此文件中
- 點擊於本行末尾的
•••
。 - 點擊 下載和儲存文件到文件夾中
/MinecraftClient/Resources/ConfigComments/
. - 查詢
MinecraftClient
->的Resources裡的
->AsciiArt
->ASCII Arts (請用 fixed-width的字元來編輯)
- 點擊於本行末尾的
•••
。 - 點擊下載並儲存文件到文件夾中
/MinecraftClient/Resources/AsciiArt/
. - 如果您想下載其他的翻譯語言,可以返回到步驟 3 。
使用 Visual Studio 建置
- 使用 Visual Studio 打開
MinecraftClient.sln
- 在
方案總管(Solution Explorer)
中右鍵MinecraftClient
方案 - 點擊
屬性(Properties)
- 打開
建置(Build)
分頁,選擇Release
配置 - 按
CTRL + S
儲存後關閉分頁 - 在
方案總管(Solution Explorer)
中右鍵MinecraftClient
方案 - 點擊
建置(Build)
If the build has succeeded, the compiled binary MinecraftClient.exe
will be in MinecraftClient/bin/Release/net7.0/win-x64/publish
folder.
手動使用 .NET 建置
- 打開下載或克隆好的
Minecraft-Console-Client
資料夾 - 打開 PowerShell(在空白地方
右鍵
然後點擊打開 PowerShell
;或在檔案總管:檔案 -> 開啟 Windows PowerShell
) - 執行以下指令來建置專案:
dotnet publish MinecraftClient -f net7.0 -r win-x64 --no-self-contained -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
If the build has succeeded, the compiled binary MinecraftClient.exe
will be in MinecraftClient/bin/Release/net7.0/win-x64/publish
folder.
Linux,macOS
小提示
如果你正在使用 Linux,我們將假設你能夠自行安裝 Git。 如果你不知道如何安裝,為你的 Linux 發行版搜尋教學,這應該很簡單。 (基於 Debian 發行版:apt install git
,基於 Arch:pacman -S git
)
要求:
Git
Linux
.NET SDK 7.0 or new-er
使用 Git 克隆(Git clone)
- 打開終端機並移動到你將存儲 MCC 的資料夾
- 執行以下指令來遞歸地克隆 GitHub 儲存庫:
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
前往克隆好的資料夾(應該會是
Minecraft-Console-Client
)如果您想要下載翻譯資源,請點 下載翻譯資源
執行以下指令來建置專案:
在 Linux:
dotnet publish MinecraftClient -f net7.0 -r linux-x64 --no-self-contained -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
小提示
If you're using Linux that is either ARM, 32-bit, Rhel based, Using Musl, or Tirzen, find an appropriate RID for your platform and replace the
-r linux-64
with an appropriate-r RID_NAME
(Example for arm:-r linux-arm64
)在 macOS:
dotnet publish MinecraftClient -f net7.0 -r osx-x64 --no-self-contained -c Release -p:UseAppHost=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
小提示
If you're not using MAC with Intel, find an appropriate RID for your ARM processor, find an appropriate RID and replace the
-r osx-64
with an appropriate-r RID_NAME
(Example for arm:-r osx.12-arm64
)
如果建置成功,編譯好的 MinecraftClient
執行檔會在:
- Linux:
MinecraftClient/bin/Release/net7.0/linux-x64/publish/
- macOS:
MinecraftClient/bin/Release/net7.0/osx-x64/publish/
使用 Docker
要求:
- Git
- Docker 雲端
小提示
以下部分為進階使用者準備。如果你不知道如何安裝 Git 或 Docker,你可以查看其他章節,或搜尋如何安裝 Docker。
注意
請留意警告,Docker 目前可以運作,但你必須在交互模式(interactive mode)下啟動容器,否則 MCC 會崩潰。我們正在解決這個問題。
- 執行以下指令來克隆 GitHub 儲存庫:
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git --recursive
- 前往
Minecraft-Console-Client/Docker
- 使用以下指令建置 Docker 映像(Docker image)
docker build -t minecraft-console-client:latest .
使用 Docker 啟動容器:
警告
ConsoleInteractive 有一個 BUG 會導致容器在無頭模式(headless mode)啟動時會崩潰,所以你需要使用交互模式(interactive mode)。 不要使用一般方式重啟容器,停止容器後使用交互模式(interactive mode)啟動,然後使用 CTRL + P
和 CTRL + Q
來分離。
# 如果你不想掛載卷宗(volume),你可以無視 -v 參數。 如果你不掛載卷宗,想編輯 .ini 檔案時將會比較困難
docker run -it -v <你想掛載的路徑>:/opt/data minecraft-console-client:latest
現在客戶端已經運作,你可以登入。
要從客戶端分離(detach)但使客戶端繼續在後台運作,按 CTRL + P
然後按 CTRL + Q
。
使用 docker attach
指令來重新連接。
使用 docker-compose 啟動容器:
容器卷宗預設將會掛載到與 docker-compose.yml
同一資料夾下的 data
資料夾。
如果你不想掛載卷宗,你需要註解或刪除整個卷宗部分:
#volumes:
#- './data:/opt/data'
請確保啟動前你在存放 docker-compose.yml
的資料夾中。 如果是,你可以啟動容器:
docker-compose run MCC
記得使用後移除容器:
docker-compose down
如果你使用 .ini 檔案並已填入你的資料(使用者名稱,密碼,伺服器),你可以使用以下指令啟動容器:
docker-compose up
docker-compose up -d # 在後台運作
請注意當使用 docker-compose up
時,你將不能與客戶端互動。 如果你希望與客戶端互動,請使用第一個啟動方法:docker-compose run MCC
。
如上所述,你可以使用以下指令停止並刪除容器:
docker-compose down
在 Android 運行
你可以在 Android 上透過 Termux 和 Ubuntu 22.04 來使用 Minecraft 主控台客戶端,但這需要大量指令來手動設置,請小心不要遺留任何步驟。 依照你的技術水平,網絡速度和 CPU 速度,這可能需要 10 至 20 分鐘時間。
小提示
這部分將會較為技術性,我會盡力使所有東西變得簡單。 如果你遇到困難或問題,請隨意在我們的 GitHub 儲存庫建立新討論串。
小提示
**你必須擁有 Linux 的基本知識,如果完全不認識,觀看這個影片(英文無字幕)來熟悉基本指令。
小提示
為了簡化步驟,這裡我們會使用 root 帳號來安裝所有東西。如果你想建立使用者帳號,請確保你有將之後指令中的 /root
目錄替換為你的 home 目錄。
安裝
Termux 開源終端模擬器
注意
Play Store 版本的 Termux 已經過時和不支援,請不要使用。請使用 GitHub 上的。
前往 Termux GitHub 最新版本,下載 debug_universal.apk
,解壓縮並執行。
小提示
如果你的檔案管理器不允許你執行 APK 檔案,安裝 File Manager +
並在詢問時給予安裝第三方應用程式的權限。
警告
**當安裝完 Termux 後,打開它,拉出 Android 通知欄,在 Termux 的通知,往下拉直到你看見以下選項:Exit | Acquire wakelock
,點擊 Acquire wakelock
並允許 Termux 取得電量優化豁免權限。 如果你跳過此步驟,你的效能會較差而且 Termux 有可能在後台運作時被 Android 強制終止!
安裝 Ubuntu 22.04
在這裡,你有兩個選項:
- 跟隨這篇文字教學
- 觀看安裝 Ubuntu 的 YouTube 教學影片
小提示
如果你決定觀看 YouTube 教學影片,觀看至 1:58
就可以,之後的步驟不需要而且可能會令你迷惑。
為了安裝 Ubuntu 22.04 在Termux上,您必須安裝wget
and proot
, 我們將在下一步展示如何安裝。
安裝好Termux,請"依序"輸入並執行以下指令,就可以了👍
pkg update
pkg upgrade
pkg install proot wget
小提示
如果程式問你 Y/N 選擇關於 update/upgrade 問題, 輸入Y並執行就對了,因為很多都是程式運作需要的細節。
然後您需要使用以下指令,下載並使用指令集進行安裝。
wget https://raw.githubusercontent.com/MFDGaming/ubuntu-in-termux/master/ubuntu.sh
下載完畢後,輸入並執行如下指令。
bash ubuntu.sh
此時程式又會問你問題, 輸入 Y
跟按下 Enter
就對了👍。
安裝完畢後,輸入並執行以下指令,來啟動您的Ubuntu🥳:
./startubuntu.sh
小提示
'當你完全關閉Termux後,想再重新進入Ubuntu時,您就必須每一次都重複輸入剛才的./startubuntu.sh的指令, 您也可以濃縮您ubuntu.sh的名稱,減少您輸入的時間⏳
安裝 .NET 在 ARM 上
Since there are issues installing .NET 7.0 via the APT package manager at the time of writing, we will have to install it manually.
首先,我們需要更新 APT 包管理器存儲庫並安裝附屬程式。
更新 APT 資料庫時, 請依序遵照下列指令 :
apt update -y && apt upgrade -y
完成後,您需要使用以下命令安裝 .NET 的附屬程式:
apt install wget nano unzip libc6 libgcc1 libgssapi-krb5-2 libstdc++6 zlib1g libicu70 libssl3 -y
安裝好附屬程式後,是時候安裝 .NET 了,您可以按照我們的步驟或前往 Microsoft one.
輸入執行 /root
來進到您的主目錄:
cd /root
First you need to download .NET 7.0, you can do it with the following command:
wget https://download.visualstudio.microsoft.com/download/pr/6cd2eaa7-4c06-4168-b90b-ee2d6bb40b10/4a8387eb07e17d262bfb9965f6d34462/dotnet-sdk-7.0.203-linux-arm64.tar.gz
小提示
This tutorial assumes that you have 64 bit version of ARM processor, if you happen to have a 32-bit version replace the link in the command above with this one
小提示
This tutorial assumes that you're following along and using Ubuntu 22.04, if you're using a different distro, like Alpine, go to here and copy an appropriate link for your distro.
Once the file has been downloaded, you need to run the following commands in order:
DOTNET_FILE=dotnet-sdk-7.0.203-linux-arm64.tar.gz
注意
If you're using a different download link, update the file name in this command to match your version.
export DOTNET_ROOT=/root/.dotnet
注意
Here we're installing .NET in
/root
, if you're installing it somewhere else, make sure to set your own path!mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
Now we need to tell our shell to know where the dotnet
command is, for future sessions, since the commands above just tell this current session where the dotnet
is located.
注意
You will need a basic knowledge of Nano text editor, if you do not know how to use it, watch this Youtube video tutorial
To enable this, we need to edit our /root/.bashrc
file with the following command:
nano /root/.bashrc
Scroll down to the bottom of the file using Page Down
(PGDN
) button, make a new line and paste the following text:
export DOTNET_ROOT=/root/.dotnet/
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
注意
Here we're installing .NET in /root
, if you're installing it somewhere else, make sure to set your own path!
Save the file usign the following combination of keys: CTRL + X
, type Y
and press Enter.
Veryfy that .NET was installed correctly by running:
dotnet
You should get a help page:
root@localhost:~# dotnet
Usage: dotnet [options]
Usage: dotnet [path-to-application]
Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.
path-to-application:
The path to an application .dll file to execute.
Installing MCC
Finally, we can install MCC.
注意
If you have a 32 ARM processor, you need to build the MCC yourself, take a look at the Building From Source section. Also make sure to be using the appropriate -r
parameter value for your architecture.
Let's make a folder where the MCC will be stored with the following command:
mkdir MinecraftConsoleClient
Then enter it the newly created folder:
cd MinecraftConsoleClient
Download the MCC with the following command:
wget https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest/download/MinecraftClient-linux-arm64.zip
Unzip it with the following command:
unzip MinecraftClient-linux-arm64.zip
You can remove the zip archive now, we do not need it anymore, with:
rm MinecraftClient-linux-arm64.zip
And finally run it with:
./MinecraftClient
After installation
When you run Termux next time, you need to start Ubuntu with: ./startubuntu.sh
Then you can start the MCC again with ./MinecraftClient
To stop MCC from running you can press CTRL + C
To edit the configuration/settings, you need a text editor, we recommend Nano, as it's very simple to use, if you have followed the installation steps above, you should be familiar with it, if not, check out this tutorial.
For downloading files, you can use the wget
file we have installed, simply run:
wget your_link_here
(you have examples above, and a video tutorial down bellow).
Also, here are some linux tutorials for people who are new to it:
- Linux Terminal Introduction by ExplainingComputers
- Linux Crash Course - nano (command-line text editor) by Learn Linux TV
- Linux Crash Course - The wget Command by Learn Linux TV
- Linux Basics: How to Untar and Unzip Files (tar, gzip) by webpwnized
Run on a VPS
小提示
This is a new section, if you find a mistake, please report it by opening an Issue in our Github repository. Thank you!
The Minecraft Console Client can be run on a VPS 24 hours, 7 days a week.
- What is a VPS?
- Prerequisites
- Where to get a VPS
- Initial Amazon VPS setup
- Initial VPS setup
- Creating a new user account
- Installing .NET Core 6
- Installing the Minecraft Console Client
What is a VPS?
VPS stands for a Virtual Private Server, it's basically a remote virtual PC that is running in the cloud, 24 hours a day, 7 days in week. To be precise, it's a virtual machine that runs on top of a host operating system (eg. Proxmox).
You can use a VPS for hosting a website, or a an app, or a game server, or your own VPN, or the Minecraft Console Client.
Here is a Youtube video that explains it in more detail if you're interested.
Prerequisites
Gitbash (if you're on Windows)
Download and install Gitbash.
小提示
Make sure to allow the installation to add it to the context menu
ssh
andssh-keygen
commands (On Windows they're available with Gitbash, on macOs and Linux they should be available by default, it not, search on how to install them)Basic knowledge of Linux shell commands, terminal emulator usage, SSH and Nano editor.
If you already know this, feel free to skip.
if you get stuck, watch those tutorials.
If you're new to this, you can learn about it here:
Where to get a VPS
You have 2 options:
Buying a VPS
If you do not want to give your info to Amazon or don't have a debit card, you can buy your own VPS.
What hardware requirements I need for running the MCC?
The MCC is not expensive to run, so it can run on basically any hardware, you do not need to spend a lot of money on a VPS if you are going to run just the MCC, go with the cheapest option.
Where to buy a VPS?
警告
In this tutorial we will be using Ubuntu 22.04
, make sure to select it as the OS when buying a VPS.
Some of the reliable and cheap hosting providers (sorted for price/performance):
Minimum price:
2.50 EUR / month
小提示
Does not have Ubuntu 22.04 in the dropdown menu when ordering, you will have to re-install later or ask support to do it.
Minimum price:
3.57 EUR / month
Minimum price:
4.51 EUR / month
Minimum price:
4 EUR / month
Minimum price:
7 EUR / month
More serious VPS able to host multiple applications, 4 CPU cores and 8 GB of RAM, 200 GB SSD
You also may want to search for better deals.
AWS EC2 VPS
警告
This will require you to have a valid debit card that can be used on internet and a mobile phone number, as well as giving that info to Amazon corporation.
注意
Scammers often get AWS VPS and use it to mass login on to stolen Microsoft accounts, some AWS IP addresses might be blocked by Microsoft because of that, if so, you might need to switch regions or to use a Proxy. To debug if your IP has been banned by Microsoft, use the ping <ip>
and traceroute <ip>
commands.
注意
Related to the warning above, if you have issues logging with Microsoft and you're not banned, you may want to check the Security center on your account and approve the login from the VPS, this can be the case for some users.
小提示
If you're not banned, sometimes fetching the keys can take some time, try giving it a minute or two, if it still hangs, hit some keys to refresh the screen, or try restarting and running again. If it still happens, use tmux instead of screen.
Register on AWS and enter all of your billing info and a phone number.
Once you're done, you can continue to Setting up the Amazon VPS.
Initial Amazon VPS setup
小提示
Skip this section if you're not using AWS. Go to Initial VPS setup
When you register and open the AWS Console
, click on the Search field on the top of the page and search for: EC2
小提示
Make sure to select the region closest to you for the minimal latency
Click on the Launch instance button.
Fill out the Name
field with a name of your preference.
For the Application and OS images select Ubuntu Server 22.04 LTS (HVM), SSD Volume Type
.
警告
Make sure that it has Free tier eligible
next to it.
For the Instance type select t2.micro
.
For the Key pair (login) click on Create new key pair and name it VpsRoot
, leave the rest of settings as default and click Create key pair, this will generate a RSA private key that will be automatically downloaded.
警告
Make sure that you save this file in a safe place and do not loose it, it's of an upmost importance since it's used to access the root/admin account of the VPS. Without it you will not be able to access the root account of the VPS! Also do not let it fall into wrong hands.
For the Network settings check the following checkboxes on:
Allow SSH traffic from
(Anywhere)Allow HTTPs traffic from the internet
Allow HTTP traffic from the internet
小提示
The SSH traffic from Anywhere is not the best thing for security, you might want to enter IP addresses of your devices from which you want to access the VPS manually.
For the Storage enter 30
.
Finally, review the Summary confirm that everything is as in the tutorial and that you will not be charged and click on the Launch instance. Once you've clicked on the button, it will take a couple of minutes for the instance to be available up and running.
Once the instance is up and running, go to it's details and copy the Public DNS v4 IP
.
You now need to login, go to your folder where you keep the private key you've generated and downloaded (make sure you make a new folder for it, do not keep in the downloads folder) and right click on the empty white space (not on files), if you're on Windows click Git Bash here, on mac OS and Linux click on Open Terminal (or whatever it is called).
In order to login with SSH, you are going to use the following command:
ssh -i <name of your private root key here> ubuntu@<your public dns v4 ip here>
小提示
<
and >
are not typed, that is just a notation for a placeholder!
小提示
ubuntu
is a default root account username for Ubuntu on AWS!
例如:
ssh -i VpsRoot.pem ubuntu@ec2-3-71-108-69.eu-central-1.compute.amazonaws.com
If you've provided the right info you should get Welcome to Ubuntu 20.04.5 LTS
message.
Now you can continue to Creating a new user
Initial VPS setup
小提示
This section if for those who do not use AWS, if you use AWS skip it
When you order the VPS, most likely you will be asked to provide the root account name and password, if it is the case, name the account as root
and give it a password of your choice.
Other option is that you will get your login info in the email once the setup is done.
Once you have the root login account info, you need Gitbash on Windows and ssh
if you're on macOS or Linux (if you do not have it by some chance, search on how to install it, it is simple).
If you're on Windows open Git Bash
, on mac OS and Linux open a Terminal
and type the following command:
ssh <username>@<ip>
小提示
If you're given a custom port other than 22
by your host, you should add -p <port here>
before the username (eg. ssh -p <port here> <username>@<ip>
) or :<port>
after the ip (eg. ssh <username>@<ip>:<port>
)
例如:
ssh root@142.26.73.14
Example with port:
ssh -p 2233 root@142.26.73.14
Once you've logged in you should see a Linux prompt and a welcome message if there is one set by your provider.
Creating a new user
Once you've logged in to your VPS you need to create a new user and give it SSH access.
In this tutorial we will be using mcc
as a name for the user account that will be running the MCC.
小提示
You may be wondering why we're creating a separate user account and making it be accessible over SSH only. This is for security reasons, if you do not want to do this, you're free to skip it, but be careful.
To create a new user named mcc
execute the following command:
sudo useradd mcc -m
Now we need to give it a password, execute the following command, type the password and confirm it:
sudo passwd mcc
小提示
When you're typing a password it will not be displayed on the screen, but you're typing it for real.
小提示
Make sure you have a strong password!
Now we need to give our user account the admin permissions:
sudo usermod -aG sudo mcc
Now we are going to set it's shell to bash:
sudo chsh mcc -s /bin/bash
Now we need to log in as the mcc
user:
su mcc
Fill in your password when asked.
Navigate to the mcc
user home directory with:
cd ~
Make a new .ssh
directory:
mkdir .ssh
Enter it with:
cd .ssh
Make a new empty file named authorized_keys
:
touch authorized_keys
Do no close the Git bash/Terminal emulator.
On your PC, make a new folder where you are going to store your SSH keys that you're going to use to log in to the user account.
Open the folder, and right click on the empty white space (not on files), if you're on Windows click Git Bash here, on mac OS and Linux click on Open Terminal (or whatever it is called).
Type the following command:
ssh-keygen -t RSA -b 4096
Enter the name of the key file to be: MCC_Key
, press Enter.
When asked for a passphrase
, enter a password of your choice and confirm it, make sure it's strong and that you remember it, best if you write it down on a piece of paper.
This will generate a private and a public key that you will use to log in to the VPS as a user that you've created.
Now open the MCC_Key.pub
file with a text editor of your choice and copy it's contents to the clipboard.
Return to the Git Bash/Terminal emulator and execute the following command:
sudo apt install nano -y
This will install the Nano editor on your VPS.
Now we need to let the SSH service on your VPS know about your newly generated SSH key pair.
Make sure you are in the /home/mcc/.ssh
folder, you can confirm this by executing:
pwd
If it does not print /home/mcc/.ssh
, navigate to it with:
cd /home/mcc/.ssh
Now you need to open the authorized_keys
file with the nano editor:
nano authorized_keys
Now paste the copied contents of the MCC_Key.pub
into the nano editor by right clicking on it.
Save the file with CTRL + O
, press Enter, and then exit it with CTRL + X
.
Now we need to configure the SSHD service to let us login with the SSH key we have generated, for this we need to edit the /etc/ssh/sshd_config
file with nano:
sudo nano /etc/ssh/sshd_config
Find the #PubkeyAuthentication yes
line and remove the #
in front to uncomment the line.
Then find the #AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
line and remove the #
to uncomment the line.
Additionally for better security you can do the following:
- Set
PermitRootLogin
toyes
- Change the
Port
to some number of your choice (22-65000) (Make sure it's at least 2 digits and avoid common ports used by other apps like: 21, 80, 35, 8080, 3000, etc...) - Uncomment
#PasswordAuthentication yes
by removing the#
in front and set it toyes
(This will disable password login, you will be able to login with SSH keys only!)
Save the file with CTRL + O
, hit Enter, close it with CTRL + X
.
Now we need to restart the SSHD service with:
sudo systemctl restart sshd
Let's check if everything is working correctly:
sudo systemctl status sshd
If everything has been configured as it should be you should see active (running)
as a status of the service.
If not, open the config file again and check for mistakes.
Press q
to exit the log mode.
Logout from the mcc
user with exit
command, and then logout from the root ubuntu
user by typing exit
again.
Now we can login to the user with our private MCC_Key
file.
Command:
ssh -i <path to the MCC_Key private key> mcc@<ip here>
例如:
ssh -i MCC_Key mcc@3.71.108.69
小提示
If you've changed the Port
, make sure you add a -p <your port here>
option after the -i <key>
option (eg. ssh -i MCC_Key -p 8973 mcc@3.71.108.69
)!
If did everything correctly you should see a Linux prompt and a welcome message if there is one on your provider.
You can do whoami
to see your username.
Now you can install .NET Core 7 and MCC.
Installing .NET Core 7
小提示
If your VPS has an ARM CPU, follow this part of the documentation and then return to section after this one.
注意
With newer versions of .NET Core 7 on Ubuntu 22.04 you might get the following error: A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders
, if you get it, use this solution
Log in as the user you've created.
Update the system packages and package manager repositories:
sudo apt update -y && sudo apt upgrade -y
Install wget
:
sudo apt install wget -y
Go to your home directory with:
cd ~
Download the Microsoft repository file:
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
Add Microsoft repositories to the package manager:
sudo dpkg -i packages-microsoft-prod.deb
Remove the file, we do not need it anymore:
rm packages-microsoft-prod.deb
Finally, install .NET Core 7:
sudo apt-get update -y && sudo apt-get install -y dotnet-sdk-7.0
Run the following command to check if everything was installed correctly:
dotnet
You should get:
Usage: dotnet [options]
Usage: dotnet [path-to-application]
Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.
path-to-application:
The path to an application .dll file to execute.
If you do not get this output and the installation was not successful, try other methods.
If it was successful, you can now install the MCC.
Installing MCC on a VPS
Now that you have .NET Core 7.0 and a user account, you should install the screen
utility, you will need this in order to keep the MCC running once you close down the SSH session (if you do not have it, the MCC will just stop working once you disconnect). You can look at the screen
like a window, except it's in a terminal, it lets you have multiple "windows" open at the same time.
小提示
There is also a Docker method, if you're using Docker, you do not need the screen
program.
You also can learn about the screen command from this Youtube tutorial.
To install the screen
execute the following command:
sudo apt install screen -y
Now you can install the MCC:
- 下載已編譯執行檔
- 從原始碼建置
- Run using Docker (Doesn't require the
screen
command)
How to use the screen
command?
注意
If you have issues with Screen command, like output not being properly formatted or program handing/freezing, try using tmux, click here to learn how to use it.
To start a screen, type:
screen -S mcc
小提示
mcc
here is the name of the screen, you can use whatever you like, but if you've used a different name, make sure you use that one instead of the mcc
in the following commands.
小提示
You need to make a screen only once, however if you reboot your VPS, you need to start it on each reboot.
Now you will be in the screen, now you can start the MCC and detach from the screen.
To detach from the screen press CTRL + A + D
.
To re-attach/return to the screen, execute the following command:
screen -r mcc
If you've accidentally closed the SSH session without detaching from the screen it might be still attached, to detach it use:
screen -d mcc
To list out screens you can use:
screen -ls
To stop the MCC, you can hit CTRL + D
(hit it few times).