Skip to content

Deploying Managi, a Lightweight Web-based SSH Management Tool, on Hugging Face

Hugging Face, colloquially known as “Hugging Face” in China, is a company focused on Natural Language Processing (NLP) and open-source AI tools, widely recognized for its open-source Transformers library. This library provides hundreds of pre-trained models supporting various tasks such as text classification, question answering, translation, and text generation. Hugging Face is dedicated to democratizing artificial intelligence, making it easy for developers and researchers to access and use state-of-the-art machine learning models and datasets. It has also built an active community platform where users can share models, datasets, and example projects, greatly promoting collaboration and innovation in AI research and applications.

Official Website

Managi is a lightweight web-based SSH management tool designed to simplify server management tasks. Users can connect to and manage multiple servers directly through a browser, supporting batch command execution, file upload/download, and other features. The project offers a clean interface and low resource consumption, suitable for both individual and team use. It supports flexible deployment methods, including quick Docker deployment. The Windows application is automatically compiled by GitHub Actions, with a transparent process that ensures reliability.

Official Website

When your overseas server (commonly called a “chicken”) is blocked by the firewall (“walled”), making it impossible to connect via SSH directly from within China, you can use a Jump Server for indirect connection. A jump server acts as an intermediate server that you can connect to from within China, which then forwards your SSH connection to the walled server, effectively “bypassing the wall” to achieve access.

Hugging Face’s Space or model hosting services will automatically “hibernate” after being inactive for a long time, requiring several seconds or even tens of seconds of “wake-up time” when accessed again. However, Managi is a lightweight web-based SSH management tool that doesn’t need to provide real-time services, making it perfect for use as a jump server.

Before deployment, you’ll need a Hugging Face account. Registration is very simple, so I won’t go into detail here.

  1. Create a Space

    • After entering the homepage, click New in the top left corner, then click Space from the dropdown chrome_bMEzfu5Tfg.webp
    • On the new Space page, fill in the Space name, select Docker, then click Create Space chrome_bMEzfu5Tfg.webp
  2. Create a Dockerfile

    • After creating the Space, click Files in the top right corner, then click Contribute, and again click Create a new file from the dropdown chrome_bMEzfu5Tfg.webp

    • In the image below, enter Dockerfile at position 1, paste the code at position 2, then click Commit file to at position 3 to create the Dockerfile

      # Use Python 3.9 Alpine image
      FROM python:3.9-alpine
      # Install git and other necessary dependencies
      RUN apk add --no-cache git
      # Set working directory
      WORKDIR /app
      # Pull code from GitHub
      RUN git clone https://github.com/hochenggang/managi-backend.git .
      # Install dependencies
      RUN pip install --no-cache-dir -r requirements.txt
      # Expose port
      EXPOSE 7860
      # Start application
      CMD ["python3", "app.py", "-p", "7860"]

    chrome_bMEzfu5Tfg.webp

    • When the status in the top left changes from blue Building chrome_bMEzfu5Tfg.webp
    • To green Running chrome_bMEzfu5Tfg.webp Our Web SSH program Managi is ready. The entire process is very fast, taking only a few seconds to build.
  3. Access Managi

    Since Hugging Face’s website is blocked by default in China, we need to use the domain provided by Hugging Face for access, which is accessible within China chrome_bMEzfu5Tfg.webp

    • Click the three dots in the top right corner, then select Embed this Space from the dropdown menu chrome_bMEzfu5Tfg.webp
    • The address in the red box in the image is the domain provided by Hugging Face, click it to access

    chrome_bMEzfu5Tfg.webp

By deploying Managi on Hugging Face, we can bypass network restrictions and achieve stable access to walled servers. This approach is particularly suitable for individual developers or small teams, eliminating the need to purchase additional jump servers while providing a good cross-platform access experience. If you’re facing issues with your server being walled or having difficulty with remote management, try this “light deployment + smart jump” combination solution - it’s simple, worry-free, and effective.