Sometimes, we need to test projects in a Linux server environment, such as websites, containers, and so on.
At this point, we need a browser, but Linux servers don't have a desktop environment. Setting aside the fact that some service providers don't support installing desktop systems like Windows, low-spec machines like 1-core 1GB servers can hardly run them.
Now we can install a browser environment in Docker and connect via VNC, or directly install Windows in Docker, but that requires high machine specs. Installing a browser is a more accessible solution.
Firefox is an open-source web browser, and that's what we'll install.
First, we need a Docker environment. For Docker installation, please refer to Installing Docker on Linux.
Of course, since you're VNC-ing into the server and using the server's network for browsing, if you have an overseas machine you could even... cough cough cough! Let's stop there!
VNC_PASSWORD= is the VNC connection password. For security, please make sure to change it.
WEB_LISTENING_PORT= is the Web VNC port number, which can be customized.
More environment variables: https://github.com/jlesage/docker-firefox?tab=readme-ov-file#environment-variables
Now open your browser and enter {Server IP}:15800 to access it (don't forget to open the firewall).
This can be solved by downloading Chinese fonts. You can find Chinese fonts online, or use the Source Han Sans provided on this site.
Then import the font into the specified directory inside the container (you'll need to re-import after rebuilding the container).
If using a different font, just replace SourceHanSansSC-Normal.otf.
I'll make a guide on installing Windows in Docker someday. After all, some projects don't need a browser, but Windows is a resource hog—Windows 10 requires at least 4 cores and 4GB RAM to barely run.