{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/pt/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Implantação de servidor Linux"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"implantação-de-servidor-linux","__idx":0},"children":["Implantação de servidor Linux"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implante o MoreLogin em um servidor Ubuntu headless e automatize perfis de navegador pela Local API — sem ambiente gráfico."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"o-que-você-alcançará","__idx":1},"children":["O que você alcançará"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ao final deste guia você terá:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A running MoreLogin instance on an Ubuntu 24.04 headless server"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Encaminhamento de rede configurado para que máquinas externas possam conectar via CDP (Chrome DevTools Protocol)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Um script de automação Python funcional que cria, inicia, controla e limpa perfis de navegador"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"visão-geral-da-arquitetura","__idx":2},"children":["Visão geral da arquitetura"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"┌──────────────────────────────────────────────────────────┐\n│                    Ubuntu 24.04 Server                   │\n│                                                          │\n│  ┌──────────────┐    ┌───────────────────────────────┐   │\n│  │   xvfb       │───▶│  MoreLogin AppImage           │   │\n│  │ (virtual     │    │  Local API :40000             │   │\n│  │  display)    │    │  CDP debug :<dynamic>         │   │\n│  │              │    │    (127.0.0.1, per profile)   │   │\n│  └──────────────┘    └───────────────────────────────┘   │\n│                              │                           │\n│                        socat forwarding                  │\n│                              │                           │\n│                     0.0.0.0:40001 → 127.0.0.1:40000      │\n│                     0.0.0.0:<N+1> → 127.0.0.1:<N>        │\n└──────────────────────────────────────────────────────────┘\n                               │\n                          External machine\n                     (Playwright / Puppeteer / Selenium)\n"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ","A porta de depuração CDP é ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["dinâmica"]}," — cada perfil de navegador recebe a sua própria porta, retornada pela resposta de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/start"]},"."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pré-requisitos","__idx":3},"children":["Pré-requisitos"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Requisito"},"children":["Requisito"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Detalhes"},"children":["Detalhes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sistema operacional"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ubuntu 24.04 Server (x86_64)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Especificações recomendadas"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["8 vCPU, 8 GB RAM (supports ~5 concurrent profiles)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rede"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Acesso de saída à Internet; open inbound port ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["40001"]}," and the forwarded CDP ports you choose, or use SSH tunnels instead"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Python"]}," (opcional)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Python 3.8+ with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pip"]}," for running the example script"]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"passo-1--instalar-dependências-do-sistema","__idx":4},"children":["Passo 1 — Instalar dependências do sistema"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Conecte-se ao servidor por SSH e instale os pacotes necessários:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# FUSE support (required for AppImage)\nsudo apt install -y libfuse2t64\n\n# GTK / accessibility / display libraries\nsudo apt install -y libatk1.0-0 libatk-bridge2.0-0 libatspi2.0-0\nsudo apt install -y libcups2\nsudo apt install -y libgtk-3-0 libgdk-pixbuf2.0-0\nsudo apt install -y libgbm1 libxkbcommon0 libasound2t64\n\n# Virtual framebuffer (headless display)\nsudo apt install -y xvfb\n\n# TCP forwarder\nsudo apt install -y socat\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"instalar-fontes-opcional","__idx":5},"children":["Instalar fontes (opcional)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Se as páginas do navegador aparecerem sem texto ou com caracteres faltando, instale os pacotes de fontes correspondentes:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# CJK (Chinese, Japanese, Korean)\nsudo apt install -y fonts-noto-cjk fonts-noto-cjk-extra\n\n# Arabic\nsudo apt install -y fonts-noto-color-emoji fonts-noto-extra\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para outros idiomas, instale o pacote correspondente da ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://fonts.google.com/noto"},"children":["família de fontes Noto"]},"."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"passo-2--baixe-e-inicie-maislogin","__idx":6},"children":["Passo 2 — Baixe e inicie maisLogin"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"21-baixe-o-appimage","__idx":7},"children":["2.1 Baixe o AppImage"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"wget https://get.morelogin.com/client/prod/linux/x64/2.54.0/MoreLogin_x86_64_2.54.0.AppImage\nchmod +x MoreLogin_x86_64_2.54.0.AppImage\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Substitua ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2.54.0"]}," pela versão mais recente disponível na sua conta MoreLogin ou na ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.morelogin.com/download/"},"children":["página de download"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"22-iniciar-mais-login-em-segundo-plano","__idx":8},"children":["2.2 Iniciar mais Login em segundo plano"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xvfb-run"]}," para fornecer um display virtual e então execute o AppImage:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"nohup xvfb-run -a ./MoreLogin_x86_64_2.54.0.AppImage --no-sandbox > morelogin.log 2>&1 &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verifique se foi iniciado com sucesso:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Check the process is running\nps aux | grep MoreLogin\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["O processo pode levar de 5 a 10 segundos para inicializar por completo."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3--log-in-to-morelogin-via-api-required","__idx":9},"children":["Step 3 — Log In to MoreLogin via API (Required)"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!CAUTION]"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Você deve fazer login antes de chamar qualquer outro endpoint da API local."]}," Em um servidor headless, não há GUI para fazer login manualmente, portanto, você deve autenticar por meio da API. Sem esta etapa, todas as chamadas de API retornarão:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\"status\": \"error\", \"code\": 401, \"message\": \"Your login status has expired, please log in again\"}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"31-obtenha-suas-credenciais-de-api","__idx":10},"children":["3.1 Obtenha suas credenciais de API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Abra o cliente desktop do MoreLogin (em qualquer máquina onde você esteja conectado) e vá em ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Configurações → API e MCP"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image.cfac9a4c31ae47e8434739e42cab4601ee08d737bba4fccba40f2f3bc78e9648.282e0fcf.png","alt":"Configurações de API do MoreLogin — copie o APP ID e a API Key na seção Open API"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"32-faça-login-via-curl","__idx":11},"children":["3.2 Faça login via curl"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Chame o endpoint de login com suas credenciais:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST http://127.0.0.1:40000/api/user/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"apiId\": \"YOUR_APP_ID\",\n    \"apiKey\": \"YOUR_API_KEY\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Uma resposta bem-sucedida é semelhante a:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\"code\": 0, \"msg\": null, \"data\": true}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"33-verifique-o-login","__idx":12},"children":["3.3 Verifique o login"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Confirme que a API está pronta listando os perfis de navegador:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -s -X POST http://127.0.0.1:40000/api/env/page \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"pageNo\": 1, \"pageSize\": 1}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Uma resposta ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"code\":0, ...}"]}," significa que você está autenticado e a API está pronta."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Ponto de verificação:"]}," seu servidor MoreLogin está totalmente operacional. Siga para o ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-4--configure-network-forwarding-socat"},"children":["Passo 4"]},"."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ","A sessão de login persiste enquanto o processo do MoreLogin estiver em execução. Se você reiniciar o AppImage, precisará autenticar novamente."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"passo-4--configurar-o-encaminhamento-de-rede-socat","__idx":13},"children":["Passo 4 — Configurar o encaminhamento de rede (socat)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Por padrão, tanto a Local API (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[":40000"]},") quanto as portas de depuração CDP escutam em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]},". Se você precisa acessá-las de fora, encaminhe as portas."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!WARNING]"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Risco de segurança — não exponha essas portas à internet pública."]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Local API ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["não tem autenticação embutida"]}," na maioria dos endpoints."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Uma porta de depuração CDP concede ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["controle remoto total"]}," da instância do navegador (ler cookies, injetar scripts, capturar tela)."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Recomendações:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use um ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["túnel SSH"]}," em vez do socat para acesso remoto: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ssh -L 40000:127.0.0.1:40000 user@server"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Se precisar usar o socat, restrinja o acesso com regras de firewall a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["IPs específicos apenas"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use uma ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["VPN"]}," ou grupos de segurança do provedor de nuvem para limitar o tráfego de entrada"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Nunca"]}," abra as portas ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["40001"]}," / portas CDP para ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0.0.0.0"]}," em um servidor exposto à internet sem restrição de IP"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"41-encaminhar-a-porta-api-local","__idx":14},"children":["4.1 Encaminhar a porta API local"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"nohup socat TCP-LISTEN:40001,fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:40000 &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Máquinas externas agora podem alcançar a API em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http://<server-ip>:40001"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"42-portas-de-depuração-cdp-de-encaminhamento","__idx":15},"children":["4.2 Portas de depuração CDP de encaminhamento"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you start a browser profile via the API, the response includes a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["dynamic"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort"]}," (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["9222"]},"). Cada perfil pode receber uma porta diferente. Forward it so external automation tools (Playwright, Puppeteer, Selenium) can connect:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Example: if debugPort=9222, forward to external port 9223 (debugPort + 1)\n# Adjust both ports to match the actual debugPort returned by /api/env/start\nnohup socat TCP-LISTEN:9223,fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:9222 &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!WARNING]"," ","Ao executar vários perfis simultaneamente, garanta que as portas encaminhadas não colidam com as portas de depuração de outros perfis."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"," ","Em produção, crie o encaminhamento socat ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["dinamicamente"]}," após cada chamada de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/start"]},", usando o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort"]}," retornado."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Se os scripts de automação rodam ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["no mesmo servidor"]},", você pode dispensar o socat e conectar direto em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"43-abrir-portas-de-firewall","__idx":16},"children":["4.3 Abrir portas de firewall"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Se você usar o socat, restrinja o acesso apenas a IPs confiáveis:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Allow only a specific IP (recommended)\nsudo ufw allow from <YOUR_IP> to any port 40001 proto tcp\nsudo ufw allow from <YOUR_IP> to any port 9223 proto tcp\n\n# Or allow from any IP (NOT recommended for production)\n# sudo ufw allow 40001/tcp\n# sudo ufw allow 9223/tcp\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"44-recomendado-use-o-túnel-ssh","__idx":17},"children":["4.4 Recomendado: use o túnel SSH"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para o acesso remoto mais seguro, use um túnel SSH — sem mudanças de firewall nem socat."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Como a porta CDP é ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["dinâmica"]}," (atribuída quando você inicia um perfil), o fluxo é:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Túnel a porta da API primeiro:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Run this on your local machine\nssh -L 40000:127.0.0.1:40000 user@<server-ip>\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Inicie o perfil"]}," pela API tunelada (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http://127.0.0.1:40000/api/env/start"]},") e leia o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort"]}," retornado."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Abra um segundo túnel para a porta CDP:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Replace <debugPort> with the actual port returned by the API\nssh -L <debugPort>:127.0.0.1:<debugPort> user@<server-ip>\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Conecte"]}," em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http://127.0.0.1:<debugPort>"]}," a partir dos seus scripts Playwright / Puppeteer, como se o servidor fosse local."]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"," ","Você pode combinar os dois túneis em um único comando se souber a faixa de portas com antecedência, por exemplo:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"ssh -L 40000:127.0.0.1:40000 -L 9222:127.0.0.1:9222 -L 9223:127.0.0.1:9223 user@<server-ip>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mas na prática é mais fácil abrir primeiro o túnel da API e depois adicionar túneis por perfil conforme necessário."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"passo-5--exemplo-de-automação-rápida","__idx":18},"children":["Passo 5 — Exemplo de automação rápida"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Abaixo está um exemplo mínimo em Python mostrando o ciclo de vida completo de um perfil de navegador. Para o script de produção completo, veja o repositório de demos."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"51-instalar-dependências-do-python","__idx":19},"children":["5.1 Instalar dependências do Python"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"pip install requests playwright\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["O Playwright é usado aqui apenas pelo seu cliente CDP (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["connect_over_cdp"]},"). Você ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["não"]}," precisa executar ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["playwright install"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"52-definir---no-sandbox-para-perfis-de-navegador-obrigatório-no-linux","__idx":20},"children":["5.2 Definir ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-sandbox"]}," para Perfis de Navegador (Obrigatório no Linux)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No Linux Server, o mecanismo do navegador ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["deve"]}," ser executado com a flag ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-sandbox"]},". Você passa este parâmetro através do campo ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startupParams"]}," ao criar ou atualizar um perfil de navegador."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!CAUTION]"," ","Sem ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-sandbox"]},", o navegador não conseguirá iniciar na maioria dos ambientes de servidor Linux (especialmente ao executar como ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["root"]}," ou sem uma sessão de desktop completa)."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"novos-perfis--incluir-startupparams-na-criação","__idx":21},"children":["Novos perfis — incluir ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startupParams"]}," na criação"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/create/advanced"]}," para criar um perfil com ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startupParams"]}," (o endpoint ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/create/quick"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["não suporta"]}," este campo):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST http://127.0.0.1:40000/api/env/create/advanced \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"browserTypeId\": 1,\n    \"operatorSystemId\": 5,\n    \"startupParams\": [\"--no-sandbox\"]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"," ","Se você usou ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/create/quick"]}," para criar o perfil, chame ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/update"]}," para adicionar ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-sandbox"]}," antes de iniciar — veja abaixo."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"perfis-existentes--atualizar-via-apienvupdate","__idx":22},"children":["Perfis existentes — atualizar via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/update"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Se você já possui perfis de navegador criados sem ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-sandbox"]},", atualize-os antes de iniciar:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST http://127.0.0.1:40000/api/env/update \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"envId\": \"YOUR_ENV_ID\",\n    \"startupParams\": [\"--no-sandbox\"]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ","O campo ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startupParams"]}," aceita um array de strings. Você também pode incluir outras flags do Chrome (por exemplo, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[\"--no-sandbox\", \"--disable-gpu\"]"]},"). A flag ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--no-sandbox"]}," é necessária apenas no Linux — perfis Windows e macOS não precisam dela."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"53-criar--iniciar--automatizar--limpeza","__idx":23},"children":["5.3 Criar → Iniciar → Automatizar → Limpeza"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Este exemplo pressupõe que o script roda ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["no mesmo servidor"]}," que o MoreLogin. Para cenários remotos, veja as observações abaixo."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import requests\nfrom playwright.sync_api import sync_playwright\n\n# ── Configuration ──────────────────────────────────────────\n# Local:  script runs on the SAME server as MoreLogin\n# Remote: script runs on a DIFFERENT machine — see notes below\nAPI_BASE  = \"http://127.0.0.1:40000\"\n\n\n# ① Create a browser profile\nresp = requests.post(f\"{API_BASE}/api/env/create/quick\", json={\n    \"browserTypeId\": 1,\n    \"operatorSystemId\": 5,\n    \"quantity\": 1\n})\nresp_data = resp.json()\nassert resp_data[\"code\"] == 0, f\"Create failed: {resp_data}\"\nenv_id = resp_data[\"data\"][\"envIds\"][0]\nprint(f\"✅ Created profile: {env_id}\")\n\n\n# ①-b Add --no-sandbox (required on Linux Server)\nresp = requests.post(f\"{API_BASE}/api/env/update\", json={\n    \"envId\": env_id,\n    \"startupParams\": [\"--no-sandbox\"]\n})\nresp_data = resp.json()\nassert resp_data[\"code\"] == 0, f\"Update failed: {resp_data}\"\nprint(f\"✅ Set --no-sandbox for profile: {env_id}\")\n\n\n# ② Start the profile (headless)\nresp = requests.post(f\"{API_BASE}/api/env/start\", json={\n    \"envId\": env_id\n})\nresp_data = resp.json()\nassert resp_data[\"code\"] == 0, f\"Start failed: {resp_data}\"\ndebug_port = resp_data[\"data\"][\"debugPort\"]   # Dynamic — different for each profile\nprint(f\"✅ Started — debug port: {debug_port}\")\n\n\n# ③ Build the CDP URL\ncdp_url = f\"http://127.0.0.1:{debug_port}\"\n\n\n# ④ Connect via CDP and automate\nwith sync_playwright() as p:\n    browser = p.chromium.connect_over_cdp(cdp_url)\n    page = browser.contexts[0].pages[0]\n    page.goto(\"https://www.google.com\")\n    page.screenshot(path=f\"screenshot_{env_id}.png\")\n    print(f\"✅ Screenshot saved\")\n    # Use disconnect() — not close() — to detach without killing the browser.\n    # The profile will be stopped cleanly via the API in step ⑤.\n    browser.disconnect()\n\n\n# ⑤ Stop the profile\nrequests.post(f\"{API_BASE}/api/env/close\", json={\"envId\": env_id})\nprint(f\"✅ Profile stopped\")\n\n\n# ⑥ Delete the profile\nrequests.post(f\"{API_BASE}/api/env/remove\", json={\"envIds\": [env_id]})\nprint(f\"✅ Profile deleted\")\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Running from a remote machine?"]}," Two approaches:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Opção A — túnel SSH (recomendado):"]}," ","Configure túneis SSH da sua máquina local para o servidor (consulte ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#44-recommended-use-ssh-tunnel-instead"},"children":["§ 4.4"]},") e mantenha ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_BASE = \"http://127.0.0.1:40000\""]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cdp_url = f\"http://127.0.0.1:{debug_port}\""]}," — o SSH faz com que as portas remotas pareçam locais."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Opção B — socat no servidor:"]}," ","No ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["servidor"]},", inicie o encaminhamento socat para a porta da API e para cada porta CDP:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Execute isto no SERVIDOR, não na sua máquina local\nsocat TCP-LISTEN:40001,fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:40000 &\nsocat TCP-LISTEN:$((debug_port+1)),fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:$debug_port &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then in your script, set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_BASE = \"http://<server-ip>:40001\""]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cdp_url = f\"http://<server-ip>:{debug_port + 1}\""]},"."," ","⚠️ Restrinja o acesso com regras de firewall — veja ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#43-open-firewall-ports"},"children":["§ 4.3"]},"."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!IMPORTANT]"," ","The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resp.json()[\"data\"][\"envIds\"]"]}," structure matches the current ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/create/quick"]}," response format. Se você encontrar um formato diferente (por exemplo, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data: [\"id1\", ...]"]},"), verifique a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt/api-reference/browser"},"children":["Referência da API"]}," da sua versão. Os formatos de resposta podem variar entre as versões."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"referência-de-desempenho","__idx":24},"children":["Referência de desempenho"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Os resultados a seguir foram obtidos em uma VM Ubuntu 24.04 Server (8 vCPU, 8 GB de RAM) usando o script completo de teste de estresse."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Métrica"},"children":["Métrica"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Valor"},"children":["Valor"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Total de corridas"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Simultaneidade"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4 (simultâneo)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Taxa de sucesso"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100,0%"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tempo total"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["604,06s"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tempo médio por tarefa"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6,04s"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rendimento"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0,17 tarefas/s"]}]}]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Esses números servem como base. Actual performance depends on server specs, network conditions, and page complexity."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"implantação-de-produção-systemd","__idx":25},"children":["Implantação de produção (systemd)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Em servidores de produção, execute o MoreLogin como um ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["serviço systemd"]}," para ter inicialização automática no boot e reinício em caso de falha."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"crie-o-arquivo-de-serviço","__idx":26},"children":["Crie o arquivo de serviço"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo tee /etc/systemd/system/morelogin.service > /dev/null <<'EOF'\n[Unit]\nDescription=MoreLogin Browser (headless)\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nUser=root\nWorkingDirectory=/opt/morelogin\nExecStart=/usr/bin/xvfb-run -a /opt/morelogin/MoreLogin_x86_64_2.54.0.AppImage --no-sandbox\nRestart=on-failure\nRestartSec=10\nStandardOutput=journal\nStandardError=journal\n\n[Install]\nWantedBy=multi-user.target\nEOF\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ajuste os caminhos de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WorkingDirectory"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ExecStart"]}," para onde você colocou o AppImage."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"," ","Para produção, considere criar um usuário dedicado (por exemplo, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["morelogin"]},") em vez de executar como ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["root"]}," e ajuste a propriedade e as permissões do arquivo de acordo. Se o AppImage atualmente exigir privilégios de root, você poderá manter ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["User=root"]},", mas isolar o processo em uma conta não root é uma prática recomendada."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"habilitar-e-iniciar","__idx":27},"children":["Habilitar e iniciar"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo systemctl daemon-reload\nsudo systemctl enable morelogin    # Auto-start on boot\nsudo systemctl start morelogin     # Start now\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"gerenciar-o-serviço","__idx":28},"children":["Gerenciar o serviço"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo systemctl status morelogin    # Check status\nsudo journalctl -u morelogin -f    # Stream logs\nsudo systemctl restart morelogin   # Restart\nsudo systemctl stop morelogin      # Stop\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ","Após um reinício, você precisa chamar o ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#32-log-in-via-curl"},"children":["endpoint de login"]}," novamente — a sessão da API não sobrevive ao reinício."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"solução-de-problemas","__idx":29},"children":["Solução de problemas"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"morelogin-não-inicia","__idx":30},"children":["MoreLogin não inicia"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"AppImages require FUSE to run.\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Correção:"]}," Instale o suporte FUSE:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo apt install -y libfuse2t64\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"páginas-do-navegador-aparecem-sem-texto--com-caracteres-faltando","__idx":31},"children":["Páginas do navegador aparecem sem texto / com caracteres faltando"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Correção:"]}," instale o pacote de fontes do idioma desejado (veja ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#install-fonts-optional-but-recommended"},"children":["Passo 1 — Instalar fontes"]},")."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"conexão-cdp-recusada-pela-máquina-externa","__idx":32},"children":["Conexão CDP recusada pela máquina externa"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cause:"]}," CDP debug ports bind to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]}," by default."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Correção:"]}," configure o encaminhamento socat (veja ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-4--configure-network-forwarding-socat"},"children":["Passo 4"]},") e garanta que o firewall permita a porta."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"curl-to-local-api-returns-connection-refused","__idx":33},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["curl"]}," to Local API returns \"Connection refused\""]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Causa:"]}," o MoreLogin ainda não terminou de iniciar, ou o processo travou."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Correção:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Aguarde 5 a 10 segundos após a inicialização"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verifique se há erros no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["morelogin.log"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verifique se o processo está em execução: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ps aux | grep MoreLogin"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-retorna-401-status-de-login-expirou","__idx":34},"children":["API retorna 401 “status de login expirou”"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\"status\": \"error\", \"code\": 401, \"message\": \"Your login status has expired, please log in again\"}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Causa:"]}," você não fez login pela API, ou o processo do MoreLogin foi reiniciado."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Correção:"]}," chame o endpoint de login antes de qualquer outra chamada de API (veja ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-3--log-in-to-morelogin-via-api-required"},"children":["Passo 3"]},")."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"próximas-etapas","__idx":35},"children":["Próximas etapas"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Objetivo"},"children":["Objetivo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ligação"},"children":["Ligação"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Referência completa da API do navegador"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt/api-reference/browser"},"children":["API do navegador"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configuração de autenticação"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt/api-reference/getting-started/authentication"},"children":["Guia de autenticação"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Exemplos de dramaturgo / selênio / titereiro"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt/api-reference/examples"},"children":["Exemplos de automação"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Script completo de teste de estresse do Linux"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/MoreLoginBrowser/MoreLogin-API-Demos/blob/main/MoreLogin-Python/linux_server_test.py"},"children":["GitHub — linux_server_test.py"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Início rápido da CLI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pt/cli/quick-start"},"children":["Guia CLI"]}]}]}]}]}]}]},"headings":[{"value":"Implantação de servidor Linux","id":"implantação-de-servidor-linux","depth":1},{"value":"O que você alcançará","id":"o-que-você-alcançará","depth":2},{"value":"Visão geral da arquitetura","id":"visão-geral-da-arquitetura","depth":2},{"value":"Pré-requisitos","id":"pré-requisitos","depth":2},{"value":"Passo 1 — Instalar dependências do sistema","id":"passo-1--instalar-dependências-do-sistema","depth":2},{"value":"Instalar fontes (opcional)","id":"instalar-fontes-opcional","depth":3},{"value":"Passo 2 — Baixe e inicie maisLogin","id":"passo-2--baixe-e-inicie-maislogin","depth":2},{"value":"2.1 Baixe o AppImage","id":"21-baixe-o-appimage","depth":3},{"value":"2.2 Iniciar mais Login em segundo plano","id":"22-iniciar-mais-login-em-segundo-plano","depth":3},{"value":"Step 3 — Log In to MoreLogin via API (Required)","id":"step-3--log-in-to-morelogin-via-api-required","depth":2},{"value":"3.1 Obtenha suas credenciais de API","id":"31-obtenha-suas-credenciais-de-api","depth":3},{"value":"3.2 Faça login via curl","id":"32-faça-login-via-curl","depth":3},{"value":"3.3 Verifique o login","id":"33-verifique-o-login","depth":3},{"value":"Passo 4 — Configurar o encaminhamento de rede (socat)","id":"passo-4--configurar-o-encaminhamento-de-rede-socat","depth":2},{"value":"4.1 Encaminhar a porta API local","id":"41-encaminhar-a-porta-api-local","depth":3},{"value":"4.2 Portas de depuração CDP de encaminhamento","id":"42-portas-de-depuração-cdp-de-encaminhamento","depth":3},{"value":"4.3 Abrir portas de firewall","id":"43-abrir-portas-de-firewall","depth":3},{"value":"4.4 Recomendado: use o túnel SSH","id":"44-recomendado-use-o-túnel-ssh","depth":3},{"value":"Passo 5 — Exemplo de automação rápida","id":"passo-5--exemplo-de-automação-rápida","depth":2},{"value":"5.1 Instalar dependências do Python","id":"51-instalar-dependências-do-python","depth":3},{"value":"5.2 Definir --no-sandbox para Perfis de Navegador (Obrigatório no Linux)","id":"52-definir---no-sandbox-para-perfis-de-navegador-obrigatório-no-linux","depth":3},{"value":"Novos perfis — incluir startupParams na criação","id":"novos-perfis--incluir-startupparams-na-criação","depth":4},{"value":"Perfis existentes — atualizar via /api/env/update","id":"perfis-existentes--atualizar-via-apienvupdate","depth":4},{"value":"5.3 Criar → Iniciar → Automatizar → Limpeza","id":"53-criar--iniciar--automatizar--limpeza","depth":3},{"value":"Referência de desempenho","id":"referência-de-desempenho","depth":2},{"value":"Implantação de produção (systemd)","id":"implantação-de-produção-systemd","depth":2},{"value":"Crie o arquivo de serviço","id":"crie-o-arquivo-de-serviço","depth":3},{"value":"Habilitar e iniciar","id":"habilitar-e-iniciar","depth":3},{"value":"Gerenciar o serviço","id":"gerenciar-o-serviço","depth":3},{"value":"Solução de problemas","id":"solução-de-problemas","depth":2},{"value":"MoreLogin não inicia","id":"morelogin-não-inicia","depth":3},{"value":"Páginas do navegador aparecem sem texto / com caracteres faltando","id":"páginas-do-navegador-aparecem-sem-texto--com-caracteres-faltando","depth":3},{"value":"Conexão CDP recusada pela máquina externa","id":"conexão-cdp-recusada-pela-máquina-externa","depth":3},{"value":"curl to Local API returns \"Connection refused\"","id":"curl-to-local-api-returns-connection-refused","depth":3},{"value":"API retorna 401 “status de login expirou”","id":"api-retorna-401-status-de-login-expirou","depth":3},{"value":"Próximas etapas","id":"próximas-etapas","depth":2}],"frontmatter":{"seo":{"title":"Implantação de servidor Linux"}},"lastModified":"2026-09-03T06:29:47.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pt/linux-server/overview","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}