Skip to content

PasteFerry (隔空贴): clipboard and file sync across macOS, Windows and Linux. Direct-first, end-to-end encrypted. Optional official access: no server to host. Independent self-hosting remains available.

37.5 KB
Raw Blame
<!doctype html>
<html lang="ja">
<head>
  <meta charset="utf-8">
  <script>
    (function () {
      if (location.hostname !== "baiyuze.github.io") return;
      var prefix = /^\/(?:pasteferry|copysync)(?=\/|$)/.exec(location.pathname);
      if (!prefix) return;
      var path = location.pathname.slice(prefix[0].length) || "/";
      location.replace("https://pasteferry.cc" + path + location.search + location.hash);
    })();
  </script>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>LAN に PasteFerry サーバーを置く:Windows・Mac・Linux の手順</title>
  <meta name="description" content="コンピューターが同じネットワークにあれば、クラウドサーバーは要りません。常に電源が入っている Windows・Mac・Linux のコンピューターで、PasteFerry のシグナリング兼 TURN サーバーをスクリプトひとつで動かせます。起動時に自動で立ち上がります。アプリの設定とトラブル対処つき。">
  <link rel="canonical" href="https://pasteferry.cc/ja/server/">
  <link rel="alternate" hreflang="zh-CN" href="https://pasteferry.cc/server/">
  <link rel="alternate" hreflang="zh-TW" href="https://pasteferry.cc/zh-tw/server/">
  <link rel="alternate" hreflang="zh-HK" href="https://pasteferry.cc/zh-hk/server/">
  <link rel="alternate" hreflang="en" href="https://pasteferry.cc/en/server/">
  <link rel="alternate" hreflang="ja" href="https://pasteferry.cc/ja/server/">
  <meta name="theme-color" content="#141416">
  <meta property="og:type" content="article">
  <meta property="og:site_name" content="PasteFerry">
  <meta property="og:title" content="LAN に PasteFerry サーバーを置く:Windows・Mac・Linux の手順">
  <meta property="og:description" content="コンピューターが同じネットワークにあれば、クラウドサーバーは要りません。常に電源が入っている Windows・Mac・Linux のコンピューターで、PasteFerry のシグナリング兼 TURN サーバーをスクリプトひとつで動かせます。起動時に自動で立ち上がります。アプリの設定とトラブル対処つき。">
  <meta property="og:url" content="https://pasteferry.cc/ja/server/">
  <meta property="og:image" content="https://pasteferry.cc/assets/og-en.png">
  <meta property="og:locale" content="ja_JP">
  <meta name="twitter:card" content="summary_large_image">
  <link rel="icon" href="../../assets/favicon.svg?v=df696024d8" type="image/svg+xml">
  <link rel="icon" href="../../assets/favicon-32.png?v=8e9afa506d" sizes="32x32" type="image/png">
  <link rel="apple-touch-icon" href="../../assets/apple-touch-icon.png?v=bcbf406cb8">
  <link rel="stylesheet" href="../../assets/site.css?v=dbae55d27c">
  <script>document.documentElement.classList.add("js");if (!/Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent)) document.documentElement.classList.add("pc");</script>
</head>
<body>
  <a class="skip" href="#main">本文へ移動</a>

  <header class="bar">
    <div class="wrap">
      <a class="brand" href="../../ja/" aria-label="PasteFerry ホーム"><img src="../../assets/icon.svg?v=65a69999e0" alt="" width="26" height="26">PasteFerry</a>
      <nav aria-label="ページ内の移動">
        <a href="../../ja/features/">機能</a>
        <a class="mid" href="../../ja/start/">はじめかた</a>
        <a class="wide" href="../../ja/start/#server" aria-current="true">接続方法</a>
        <a href="../../ja/download/">ダウンロード</a>
        <details class="menu">
          <summary aria-label="その他のページ"><span>その他</span><svg class="chev" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3 4.5 3 3 3-3"/></svg></summary>
          <ul>
            <li class="narrow"><a href="../../ja/start/">はじめかた</a></li>
            <li class="narrow"><a href="../../ja/start/#server">接続方法</a></li>
            <li><a href="../../ja/themes/">テーマガイド</a></li>
            <li><a href="../../ja/how/">しくみ</a></li>
            <li><a href="../../ja/security/">セキュリティ</a></li>
            <li><a href="../../ja/faq/">よくある質問</a></li>
            <li><a href="../../ja/feedback/">ディスカッションとフィードバック</a></li>
            <li class="sep" role="separator"></li>
            <li><a href="https://github.com/baiyuze/pasteferry/blob/main/CHANGELOG.md">更新履歴</a></li>
            <li class="narrow-gh"><a href="https://github.com/baiyuze/pasteferry">GitHub</a></li>
          </ul>
        </details>
        <a class="gh" href="https://github.com/baiyuze/pasteferry" data-gh-stars aria-label="GitHub で PasteFerry にスターを付ける"><svg class="gh-mark" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg><span class="gh-label">Star</span><span class="gh-count" hidden><svg class="gh-star" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.751.751 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"/></svg><b></b></span></a>
        <details class="lang">
          <summary aria-label="言語:日本語"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="10" cy="10" r="7.25"/><path d="M2.75 10h14.5M10 2.75c-2.1 2-3.1 4.4-3.1 7.25s1 5.25 3.1 7.25M10 2.75c2.1 2 3.1 4.4 3.1 7.25s-1 5.25-3.1 7.25"/></svg><span>日本語</span><svg class="chev" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3 4.5 3 3 3-3"/></svg></summary>
          <ul>
            <li><a href="../../server/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a></li>
            <li><a href="../../zh-tw/server/" hreflang="zh-TW" lang="zh-TW" data-lang="zh-tw">繁體中文(台灣)</a></li>
            <li><a href="../../zh-hk/server/" hreflang="zh-HK" lang="zh-HK" data-lang="zh-hk">繁體中文(香港)</a></li>
            <li><a href="../../en/server/" hreflang="en" lang="en" data-lang="en">English</a></li>
            <li><a href="../../ja/server/" hreflang="ja" lang="ja" data-lang="ja" aria-current="page">日本語</a></li>
          </ul>
        </details>
      </nav>
    </div>
  </header>

  <main id="main">
    <section class="hero guide-hero">
      <div class="wrap">
        <p class="crumb"><a href="../../ja/">PasteFerry</a> / <a href="../../ja/start/#server">接続方法</a></p>
        <h1 class="display">LAN にサーバーを置く</h1>
        <p class="lede">家や会社のコンピューターが同じネットワークにあるなら、クラウドサーバーは要りません。電源を入れたままのコンピューターを 1 台選び、スクリプトをダウンロードして実行し、表示されたアドレスを各コンピューターの PasteFerry に入力します。</p>
        <p class="notice"><strong>同じネットワークなら、もうサーバーは要りません:</strong>アプリを入れてペアリングするだけです(<a href="../../ja/lan/">同じネットワークでの手順</a>)。このページは、2 つのサブネットがお互いに届かず、両方から届くコンピューターを経由して中継する必要がある場合に役立ちます。</p>
        <ol class="guide-toc">
          <li><a href="#prepare">準備</a></li>
          <li><a href="#install">インストール</a></li>
          <li><a href="#check">確認</a></li>
          <li><a href="#clients">アドレスの入力</a></li>
          <li><a href="#faq">よくある質問</a></li>
        </ol>
      </div>
    </section>

    <section class="section" id="overview" aria-labelledby="overview-title">
      <div class="wrap">
        <h2 id="overview-title">サーバーは引き合わせるだけ</h2>
        <p class="intro">各コンピューターはサーバーにつながったままで、それを通じて相手を見つけ、接続情報を交換します。つながったあと、コピーした内容は 2 台のあいだを直接流れます。直接つながらないときだけサーバーを中継し、その場合も暗号化されたままです。</p>
        <figure class="diagram">
          <svg viewBox="0 0 960 440" role="img" aria-labelledby="lan-title lan-desc">
            <title id="lan-title">LAN での PasteFerry</title>
            <desc id="lan-desc">同じ LAN の Mac と Windows PC が、アドレス 192.168.1.20 のサーバーにシグナリングで接続します。コピーした内容は 2 台のあいだを直接流れ、直接つながらないときだけサーバーの TURN 中継を通ります。</desc>
            <rect class="d-lan" x="8" y="8" width="944" height="384" rx="22"/>
            <text class="d-lan-label" x="32" y="42">LAN:同じ Wi‑Fi または有線ネットワーク</text>
            <rect class="d-box" x="340" y="64" width="280" height="104" rx="14"/>
            <text class="d-title" x="480" y="106" text-anchor="middle">サーバー</text>
            <text class="d-ip" x="480" y="138" text-anchor="middle">192.168.1.20</text>
            <path class="d-sig" d="M150 250V96H340"/>
            <path class="d-sig" d="M810 250V96H620"/>
            <path class="d-relay" d="M206 250V140H340"/>
            <path class="d-relay" d="M754 250V140H620"/>
            <text class="d-note" x="164" y="86">シグナリング TCP 8787</text>
            <text class="d-note" x="220" y="200">中継 UDP 3478(直接不可のとき)</text>
            <rect class="d-box" x="40" y="250" width="240" height="112" rx="14"/>
            <text class="d-title" x="160" y="300" text-anchor="middle">Mac</text>
            <text class="d-sub" x="160" y="328" text-anchor="middle">PasteFerry を使用</text>
            <rect class="d-box" x="680" y="250" width="240" height="112" rx="14"/>
            <text class="d-title" x="800" y="300" text-anchor="middle">Windows</text>
            <text class="d-sub" x="800" y="328" text-anchor="middle">PasteFerry を使用</text>
            <path class="d-direct" d="M280 306H680"/>
            <text class="d-label" x="480" y="292" text-anchor="middle">直接接続、エンドツーエンド暗号化</text>
            <text class="d-note" x="480" y="336" text-anchor="middle">内容は 2 台のあいだだけを流れる</text>
            <g class="d-legend" transform="translate(40 424)">
              <path class="d-direct" d="M0 0H28"/><text x="38" y="5">データ(直接)</text>
              <path class="d-relay" d="M250 0H278"/><text x="288" y="5">データ(中継、予備)</text>
              <path class="d-sig" d="M560 0H588"/><text x="598" y="5">シグナリング</text>
            </g>
          </svg>
        </figure>
        <ul class="points ports">
          <li><strong>シグナリング、TCP 8787。</strong>各コンピューターが常に接続し、相手の発見、ペアリング、接続情報の交換に使います。</li>
          <li><strong>直接接続。</strong>LAN 内ではほぼ必ず 2 台のあいだで直接やりとりし、速度は LAN の速度そのままです。</li>
          <li><strong>中継、UDP 3478。</strong>ゲストネットワーク、AP アイソレーションが有効な Wi‑Fi、別のサブネットなど、互いに届かないときだけ使います。</li>
        </ul>
      </div>
    </section>

    <section class="section" id="prepare" aria-labelledby="prepare-title">
      <div class="wrap">
        <h2 id="prepare-title">始める前に</h2>
        <dl class="fallbacks">
          <div><dt>電源を入れたままのコンピューター</dt><dd>Windows 10・11、macOS 13 以降、または Linux なら何でも可。同期する 2 台のうちの 1 台でもかまいません。電源が切れたりスリープしたりすると同期は止まり、復帰すると再開します。NAS、ルーター、Mac mini などが最適で、メモリは約 15 MB です。</dd></div>
          <div><dt>固定のアドレス</dt><dd>ルーターの DHCP 設定(「固定割り当て」「アドレス予約」など)で、このコンピューターのアドレスを固定します。そうしないと、アドレスが変わるたびに全部のコンピューターで入れ直すことになります。</dd></div>
          <div><dt>同じネットワークに</dt><dd>同じ Wi‑Fi か有線ネットワークにつながっていれば十分です。ゲストネットワークや AP アイソレーションが有効な Wi‑Fi ではデバイスどうしが通信できないので、別のネットワークを使うか、アイソレーションをオフにしてください。</dd></div>
          <div><dt>ネットワークの外では同期しない</dt><dd>サーバーには LAN の中からしか届きません。持ち出したノートパソコンは、戻ってきてから同期を再開します。</dd></div>
        </dl>
      </div>
    </section>

    <section class="section" id="install" aria-labelledby="install-title">
      <div class="wrap">
        <h2 id="install-title">サーバーをインストール</h2>
        <p class="intro">サーバーを動かすコンピューターの OS を選んでください。スクリプトが LAN のアドレスを見つけ、サーバーを自動起動に設定し、最後にアプリへ入力するアドレスを表示します。</p>
        <div class="os-tabs" data-tabs="os">
          <div class="tablist" role="tablist" aria-label="サーバーを動かすコンピューターの OS" hidden>
            <button type="button" role="tab" id="tab-windows" aria-controls="windows">Windows</button>
            <button type="button" role="tab" id="tab-macos" aria-controls="macos">macOS</button>
            <button type="button" role="tab" id="tab-linux" aria-controls="linux">Linux</button>
          </div>

          <section class="os" id="windows" role="tabpanel" aria-labelledby="tab-windows">
            <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="12" rx="1.5"/><path d="M9 20h6M12 16v4"/></svg>Windows</h3>
            <div class="os-grid">
              <div class="os-steps">
                <ol class="steps">
                <li><a href="https://github.com/baiyuze/pasteferry/releases/download/v2.10.1/pasteferry-server-windows-amd64.zip">pasteferry-server-windows-amd64.zip</a> をダウンロードし、右クリックで「すべて展開」します。</li>
                <li>展開したフォルダーを開き、<code>install.cmd</code> をダブルクリックします。<span class="aside">「Windows によって PC が保護されました」と出たら「詳細情報」から「実行」を、ユーザーアカウント制御が出たら「はい」を押します。サーバーはまだコード署名していないため、一度だけ確認されます。</span></li>
                <li>インストールは新しく開くウィンドウで進みます。最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。</li>
                </ol>
                <a class="button" href="https://github.com/baiyuze/pasteferry/releases/download/v2.10.1/pasteferry-server-windows-amd64.zip"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>Windows 版サーバーをダウンロード</a>
                <ul class="points">
                <li><strong>Windows サービスとして動作:</strong>Windows の起動とともに立ち上がり、サインイン不要で、ウィンドウも出ません。「サービス」では PasteFerry Server と表示されます。</li>
                <li><strong>ファイアウォールは設定済み:</strong>pasteferry-server.exe だけを対象にした受信規則をスクリプトが追加するので、ポートを開ける必要はありません。</li>
                <li><strong>アドレスが違うものになった</strong>(仮想マシンや VPN でネットワークアダプターが複数あるなど):展開したフォルダーのアドレスバーに <code>cmd</code> と入力して Enter を押し、<code>install.cmd 192.168.1.20</code> のようにアドレスを指定して実行します。</li>
                <li>Windows 10・11、x64 に対応。</li>
                </ul>
              </div>
              <div class="os-figures">
                <figure class="explorer" role="img" aria-label="展開したフォルダーには pasteferry-server.exe、install.cmd、install.ps1、README.md、uninstall.cmd があり、install.cmd をダブルクリックする">
                  <div class="t-bar win"><span class="t-tab folder">pasteferry-server-windows-amd64</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
                  <ul class="files">
                  <li><span class="f-icon exe" aria-hidden="true"></span><span class="f-name">pasteferry-server.exe</span></li>
                  <li class="hl"><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">install.cmd</span><em>ダブルクリック</em></li>
                  <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">install.ps1</span></li>
                  <li><span class="f-icon doc" aria-hidden="true"></span><span class="f-name">README.md</span></li>
                  <li><span class="f-icon cmd" aria-hidden="true"></span><span class="f-name">uninstall.cmd</span></li>
                  </ul>
                </figure>
                <figure class="term" role="img" aria-label="install.cmd の実行後のウィンドウ:旧バージョンの停止、インストール、サービス登録、ファイアウォール許可、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示">
                <div class="t-bar win"><span class="t-tab"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3 5.5 10.5 4.5v7H3zM11.5 4.4 21 3v8.5h-9.5zM3 12.5h7.5v7L3 18.5zM11.5 12.5H21V21l-9.5-1.4z"/></svg>管理者: Windows PowerShell</span><span class="t-ctl" aria-hidden="true"><i></i><i></i><i></i></span></div>
<pre class="t-body"><span class="t-step">&gt; Stopping the running version</span>
<span class="t-step">&gt; Installing to C:\Program Files\PasteFerry Server</span>
<span class="t-step">&gt; Registering the service PasteFerryServer (relay address 192.168.1.20)</span>
<span class="t-step">&gt; Allowing it through Windows Firewall</span>
<span class="t-step">&gt; Starting</span>
  √ Running

Installed: pasteferry-server 2.10.1. It runs as a Windows service and starts with Windows.
In PasteFerry on each computer, set Settings → Connection → Custom server to:

    <span class="t-url">ws://192.168.1.20:8787/signal</span>

  Program    C:\Program Files\PasteFerry Server
  Logs       C:\ProgramData\PasteFerry Server\server.log
  Restart    Restart-Service PasteFerryServer (in an administrator PowerShell)
  Uninstall  double-click uninstall.cmd</pre>
              </figure>
              </div>
            </div>
            <div class="table-scroll">
                <table class="manage">
                  <caption>あとで使うもの</caption>
                  <tbody>
                  <tr><th scope="row">状態</th><td>管理者の PowerShell で <code>Get-Service PasteFerryServer</code>、または「サービス」で PasteFerry Server を確認</td></tr>
                  <tr><th scope="row">ログ</th><td><code>C:\ProgramData\PasteFerry Server\server.log</code></td></tr>
                  <tr><th scope="row">再起動</th><td>管理者の PowerShell で <code>Restart-Service PasteFerryServer</code></td></tr>
                  <tr><th scope="row">更新</th><td>新しいバージョンをダウンロードして展開し、もう一度 <code>install.cmd</code> をダブルクリック。設定は引き継がれます</td></tr>
                  <tr><th scope="row">アンインストール</th><td><code>uninstall.cmd</code> をダブルクリック。サービス、ファイアウォール規則、ファイルをすべて削除します</td></tr>
                  </tbody>
                </table>
              </div>
          </section>

          <section class="os" id="macos" role="tabpanel" aria-labelledby="tab-macos">
            <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="5" width="16" height="11" rx="1.5"/><path d="M2 19h20"/></svg>macOS</h3>
            <div class="os-grid">
              <div class="os-steps">
                <ol class="steps">
                  <li>「ターミナル」を開き、次の行を順に実行します:
                <div class="code">
                  <button class="copy" type="button" data-done="コピーしました">コピー</button>
<pre><code>curl -LO https://github.com/baiyuze/pasteferry/releases/download/v2.10.1/pasteferry-server-macos.tar.gz
tar xzf pasteferry-server-macos.tar.gz
cd pasteferry-server-macos
./install.sh</code></pre>
                </div></li>
                <li>最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。</li>
                </ol>
                <ul class="points">
                <li><strong>管理者権限は不要です。</strong>ログインしているあいだバックグラウンドで動き、終了しても macOS が再起動します。</li>
                <li><strong>この Mac はスリープさせないでください:</strong>「システム設定 → エネルギー」(ノートは「バッテリー → オプション」)で自動スリープを防ぐ項目をオンにします。</li>
                <li><strong>macOS のファイアウォールがオンなら、</strong>スクリプトの最後に pasteferry-server を許可するコマンドが表示されます。</li>
                <li>Intel と Apple シリコンの両方に対応、macOS 13 以降。</li>
                </ul>
              </div>
              <div class="os-figures">
                <figure class="term" role="img" aria-label="ターミナルで ./install.sh を実行した出力:インストール、LaunchAgent の作成、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示">
                <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">pasteferry-server-macos — zsh</span></div>
<pre class="t-body"><span class="t-prompt">%</span> ./install.sh
<span class="t-step">▶ Stopping the running version</span>
<span class="t-step">▶ Installing to /Users/me/Library/Application Support/PasteFerry Server</span>
<span class="t-step">▶ Writing the LaunchAgent (relay address 192.168.1.20)</span>
<span class="t-step">▶ Starting</span>
  ✓ Running

Installed: pasteferry-server 2.10.1. It starts whenever you log in to this Mac.
In PasteFerry on each computer, set Settings → Connection → Custom server to:

    <span class="t-url">ws://192.168.1.20:8787/signal</span>

  Logs       /Users/me/Library/Logs/PasteFerry/server.log
  Restart    launchctl kickstart -k gui/501/com.pasteferry.server
  Uninstall  ./install.sh uninstall</pre>
              </figure>
              </div>
            </div>
            <div class="table-scroll">
                <table class="manage">
                  <caption>あとで使うもの</caption>
                  <tbody>
                  <tr><th scope="row">ログ</th><td><code>~/Library/Logs/PasteFerry/server.log</code></td></tr>
                  <tr><th scope="row">再起動</th><td><code>launchctl kickstart -k gui/$(id -u)/com.pasteferry.server</code></td></tr>
                  <tr><th scope="row">更新</th><td>新しいバージョンをダウンロードして展開し、もう一度 <code>./install.sh</code> を実行。設定は引き継がれます</td></tr>
                  <tr><th scope="row">アンインストール</th><td><code>./install.sh uninstall</code></td></tr>
                  </tbody>
                </table>
              </div>
          </section>

          <section class="os" id="linux" role="tabpanel" aria-labelledby="tab-linux">
            <h3 class="os-title"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="16" height="7" rx="1.5"/><rect x="4" y="13" width="16" height="7" rx="1.5"/><path d="M8 7.5h.01M8 16.5h.01"/></svg>Linux</h3>
            <div class="os-grid">
              <div class="os-steps">
                <ol class="steps">
                  <li>そのマシン上で(または ssh でログインして)次の行を順に実行します:<span class="aside">ARM(64 ビット OS の Raspberry Pi など)では <code>amd64</code> を <code>arm64</code> に置き換えます。</span>
                <div class="code">
                  <button class="copy" type="button" data-done="コピーしました">コピー</button>
<pre><code>curl -LO https://github.com/baiyuze/pasteferry/releases/download/v2.10.1/pasteferry-server-linux-amd64.tar.gz
tar xzf pasteferry-server-linux-amd64.tar.gz
cd pasteferry-server-linux-amd64
sudo ./install.sh</code></pre>
                </div></li>
                <li>最後に表示される <code>ws://…/signal</code> がアプリに入力するアドレスです。</li>
                </ol>
                <ul class="points">
                <li><strong>systemd サービスとして登録</strong>され、起動時に立ち上がります。root 権限が必要です。</li>
                <li><strong>ufw や firewalld が有効なら、</strong>スクリプトの最後にポートを開けるコマンドが表示されます。</li>
                <li><strong>Docker でも動かせます:</strong><code>env.example</code> を <code>.env</code> にコピーし、<code>TURN_IP</code> にこのマシンの LAN アドレスを入れて <code>docker compose up -d</code> を実行します。ホストネットワークが必要なので Linux 専用です。</li>
                </ul>
              </div>
              <div class="os-figures">
                <figure class="term" role="img" aria-label="sudo ./install.sh の出力:インストール、systemd ユニットと設定の作成、起動のあと、アドレス ws://192.168.1.20:8787/signal を表示">
                <div class="t-bar mac"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="t-title">ssh 192.168.1.20</span></div>
<pre class="t-body"><span class="t-prompt">$</span> sudo ./install.sh
<span class="t-step">▶ Installing the binary to /usr/local/bin</span>
<span class="t-step">▶ Writing the systemd unit</span>
<span class="t-step">▶ Writing /etc/pasteferry/server.env (relay address 192.168.1.20)</span>
<span class="t-step">▶ Starting</span>
  ✓ Running

Installed: pasteferry-server 2.10.1
In PasteFerry on each computer, set Settings → Connection → Custom server to:

    <span class="t-url">ws://192.168.1.20:8787/signal</span>

  Config     /etc/pasteferry/server.env
  Logs       journalctl -u pasteferry-server -f
  Restart    systemctl restart pasteferry-server
  Uninstall  sudo ./install.sh uninstall

Open in your firewall: TCP 8787 (signaling), UDP 3478 (STUN and TURN), UDP 32768-60999 (relay ports, assigned by the OS)</pre>
              </figure>
              </div>
            </div>
            <div class="table-scroll">
                <table class="manage">
                  <caption>あとで使うもの</caption>
                  <tbody>
                  <tr><th scope="row">状態</th><td><code>systemctl status pasteferry-server</code></td></tr>
                  <tr><th scope="row">ログ</th><td><code>journalctl -u pasteferry-server -f</code></td></tr>
                  <tr><th scope="row">再起動</th><td><code>sudo systemctl restart pasteferry-server</code></td></tr>
                  <tr><th scope="row">設定</th><td><code>/etc/pasteferry/server.env</code>。編集したらサービスを再起動</td></tr>
                  <tr><th scope="row">更新</th><td>新しいバージョンをダウンロードして展開し、もう一度 <code>sudo ./install.sh</code> を実行。設定は引き継がれます</td></tr>
                  <tr><th scope="row">アンインストール</th><td><code>sudo ./install.sh uninstall</code></td></tr>
                  </tbody>
                </table>
              </div>
          </section>


        </div>
      </div>
    </section>

    <section class="section" id="check" aria-labelledby="check-title">
      <div class="wrap">
        <h2 id="check-title">ほかのコンピューターから届くか確認</h2>
        <p class="intro">別のコンピューターのブラウザーで <code>http://192.168.1.20:8787/healthz</code>(あなたのアドレスに置き換え)を開きます。次の 1 行が表示されれば、ネットワークはつながっています。</p>
        <figure class="browser" role="img" aria-label="ブラウザーで http://192.168.1.20:8787/healthz を開くと、サーバーの状態 ok とバージョンが表示される">
          <div class="b-bar"><span class="t-lights" aria-hidden="true"><i></i><i></i><i></i></span><span class="b-url">http://192.168.1.20:8787/healthz</span></div>
          <pre class="b-body">{"status":"ok","version":"2.10.1"}</pre>
        </figure>
        <p class="note">開けない場合は、下の<a href="#faq">よくある質問</a>をご覧ください。</p>
      </div>
    </section>

    <section class="section" id="clients" aria-labelledby="clients-title">
      <div class="wrap">
        <h2 id="clients-title">各コンピューターにアドレスを入力</h2>
        <ol class="flow">
          <li><h3>設定を開く</h3><p>各コンピューターで PasteFerry を開き、「設定 → 接続」に進みます。サーバーを動かしているコンピューターも同じです。</p></li>
          <li><h3>アドレスを入力</h3><p>「カスタムサーバー」に <code>ws://192.168.1.20:8787/signal</code>(あなたのアドレス)を入力し、Return か Enter を押します。</p></li>
          <li><h3>状態を確認</h3><p>「接続状態」が緑の「接続済み」になれば完了です。「デバイス」でペアリングすれば、コピーが同期されるようになります。</p></li>
        </ol>
        <figure class="shot">
          <img src="../../assets/screenshots/ja/settings-lan-dark.png?v=3351f724c6" width="2112" height="1472" loading="lazy" alt="PasteFerry の「設定 → 接続」:カスタムサーバーは ws://192.168.1.20:8787/signal、接続状態は接続済み">
        </figure>
        <p class="note">アプリがまだなら、<a href="../../ja/start/">はじめかた</a>をご覧ください。</p>
      </div>
    </section>

    <section class="section" id="faq" aria-labelledby="faq-title">
      <div class="wrap">
        <h2 id="faq-title">よくある質問</h2>
        <div class="faq">
          <details>
            <summary>接続状態が「未接続」のまま</summary>
            <div class="answer"><p>まずアドレスを確認します。<code>ws://</code> で始まり、ポートは 8787、末尾は <code>/signal</code>、入力後に Return を押しているか。</p><p>次に、そのコンピューターのブラウザーで <code>http://サーバーのアドレス:8787/healthz</code> を開きます。開けなければネットワークの経路の問題です。サーバーが動いていない、そのコンピューターがスリープしている、ファイアウォールに止められている、アドレスが変わった、のいずれかです。</p><p>Windows のスクリプトはファイアウォールを設定済みです。Mac でファイアウォールがオンなら、スクリプトの最後に表示されたコマンドを実行してください。Linux の ufw、firewalld も同様です。</p></div>
          </details>
          <details>
            <summary>デバイスが「直接」ではなく「中継」になる</summary>
            <div class="answer"><p>LAN 内ではほとんどの場合直接つながります。中継になるのは 2 台のあいだで UDP が通らないからで、ゲストネットワーク、Wi‑Fi の AP アイソレーション、ファイアウォールを挟んだ別のサブネットなどが原因です。中継でも内容は暗号化されたままで、速度がサーバー側のネットワークに左右されるだけです。</p></div>
          </details>
          <details>
            <summary>サーバーのアドレスが変わった</summary>
            <div class="answer"><p>新しいアドレスを付けてスクリプトをもう一度実行します。Windows は <code>install.cmd 新しいアドレス</code>、Mac は <code>./install.sh 新しいアドレス</code>。Linux では <code>/etc/pasteferry/server.env</code> の <code>-turn-ip</code> を書き換えてサービスを再起動します。そのあと各コンピューターのアドレスも変更してください。</p><p>ルーターでアドレスを固定しておけば、こうしたことは起きません。</p></div>
          </details>
          <details>
            <summary>LAN の外でも同期できますか?</summary>
            <div class="answer"><p>できません。サーバーには LAN の中からしか届かないためです。別のネットワークでも同期するなら<a href="../../ja/official/">サービス</a>をオンにするか、<a href="../../ja/cloud/">公開サーバー</a>か <a href="../../ja/tailscale/">Tailscale</a> を使います。</p></div>
          </details>
          <details>
            <summary>サーバーを動かすコンピューターでも PasteFerry を使う場合のアドレスは?</summary>
            <div class="answer"><p>同じ LAN のアドレスで大丈夫です。<code>ws://127.0.0.1:8787/signal</code> でもかまいません。サーバーとアプリは互いに影響しません。</p></div>
          </details>
        </div>
      </div>
    </section>

    <section class="closing" aria-labelledby="closing-title">
      <div class="wrap">
        <h2 class="display" id="closing-title">電源を入れたままの<br>コンピューターが 1 台あれば十分。</h2>
        <div class="cta">
          <a class="button" href="../../ja/download/"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 3v10m0 0-4-4m4 4 4-4M4 16h12"/></svg>PasteFerry をダウンロード</a>
        </div>
        <p class="note">バージョン 2.10.1、無料・オープンソース。macOS 13 以降、Windows 10・11、Linux(x64 と ARM64)。 Android 9以降。スマホはWeb版も利用可能。</p>
        <a class="source" href="https://github.com/baiyuze/pasteferry/blob/main/server/deploy/README.md">サーバーの詳しい構築手順(グローバル IP、Docker を含む、英語・中国語)</a>
      </div>
    </section>
  </main>

  <footer class="footer">
    <div class="wrap">
      <p>PasteFerry は GNU AGPL-3.0 のオープンソースです。</p>
      <nav aria-label="フッターのリンク">
        <a href="https://github.com/baiyuze/pasteferry/releases">すべてのリリース</a>
        <a href="https://github.com/baiyuze/pasteferry/blob/main/CHANGELOG.md">更新履歴</a>
        <a href="https://pasteferry.cc/design/nat-traversal.html">技術資料(中国語)</a>
        <a href="https://github.com/baiyuze/pasteferry/blob/main/LICENSING.md">ライセンス</a>
        <a href="https://github.com/baiyuze/pasteferry/issues">問題を報告</a>
        <a href="../../ja/privacy/">プライバシー</a>
        <a href="../../ja/feedback/">ディスカッションとフィードバック</a>
      </nav>
      <nav aria-label="言語">
        <a href="../../server/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
        <a href="../../zh-tw/server/" hreflang="zh-TW" lang="zh-TW" data-lang="zh-tw">繁體中文(台灣)</a>
        <a href="../../zh-hk/server/" hreflang="zh-HK" lang="zh-HK" data-lang="zh-hk">繁體中文(香港)</a>
        <a href="../../en/server/" hreflang="en" lang="en" data-lang="en">English</a>
        <a href="../../ja/server/" hreflang="ja" lang="ja" data-lang="ja" aria-current="page">日本語</a>
      </nav>
    </div>
  </footer>

  <script src="../../assets/site.js?v=fb60f6e5ce" defer></script>
  <script src="/assets/analytics.js?v=e2777f714d" defer></script>
  <script type="module" src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "7ee226baf4a949a397c4bfd69a9e7461"}'></script>
</body>
</html>