<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammad Junaid on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Junaid on Medium]]></description>
        <link>https://medium.com/@itzmjunaid?source=rss-c8663592afbf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ds2gtkumz3jmS_OyovvQIQ.jpeg</url>
            <title>Stories by Muhammad Junaid on Medium</title>
            <link>https://medium.com/@itzmjunaid?source=rss-c8663592afbf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 18:34:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@itzmjunaid/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Connected Google Drive to a Headless Linux Server Using Rclone (Without Losing My Mind)]]></title>
            <link>https://medium.com/@itzmjunaid/how-i-connected-google-drive-to-a-headless-linux-server-using-rclone-without-losing-my-mind-e767babedef0?source=rss-c8663592afbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/e767babedef0</guid>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[rclone]]></category>
            <category><![CDATA[vps]]></category>
            <category><![CDATA[service-worker]]></category>
            <category><![CDATA[google-drive]]></category>
            <dc:creator><![CDATA[Muhammad Junaid]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 21:19:06 GMT</pubDate>
            <atom:updated>2025-12-24T21:19:06.811Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever tried setting up <strong>rclone with Google Drive on a headless server</strong>, you already know the annoying part:</p><p>Google wants you to “open a browser” to authenticate…</p><p>…but your server doesn’t even <em>have</em> a browser.</p><p>So you end up stuck in that awkward loop of copying links, pasting tokens, trying random flags, and wondering why something so simple feels like a puzzle.</p><p>The good news? There’s a clean solution.</p><p>In this article, I’ll walk you through the easiest and most reliable way to set up <strong>rclone + Google Drive on a headless VPS</strong> using an <strong>SSH tunnel</strong>.</p><p>It’s quick, it’s secure, and it doesn’t involve weird workarounds.</p><h3>Quick Context: What is Rclone?</h3><p>If you’re new to rclone, think of it like <strong>rsync for cloud storage</strong>.</p><p>You can use it to:</p><ul><li>sync your server files to Google Drive</li><li>mount Google Drive like a disk</li><li>automate backups</li><li>copy data across cloud providers</li></ul><p>And it works beautifully once it’s configured.</p><h3>The Problem with Headless Servers</h3><p>On a normal machine, rclone opens your browser for Google authorization.</p><p>On a headless server (VPS / remote Linux box), there is no browser — so rclone can’t complete login the usual way.</p><p>That’s where the <strong>SSH tunnel method</strong> comes in.</p><h3>The Best Way: Use an SSH Tunnel (Recommended)</h3><p>This method is honestly the smoothest one if you have SSH access.</p><p>Here’s what we’ll do:</p><p>✅ Start rclone config on the server<br>✅ Create a tunnel from your laptop to the server<br>✅ Open the Google auth link in your own browser<br>✅ Done</p><p>Let’s go step-by-step.</p><h3>Step 1 — Start the Rclone Config on Your Server</h3><p>SSH into your server as usual:</p><pre>ssh user@your_server_ip</pre><p>Then run:</p><pre>rclone config</pre><p>Now rclone will ask you a series of questions. Here’s what to choose:</p><h3>✅ Create a new remote</h3><p>Type:</p><pre>n</pre><h3>✅ Name it</h3><p>Give it a friendly name like:</p><pre>gdrive</pre><h3>✅ Choose Google Drive</h3><p>Pick <strong>Google Drive</strong> from the list (it’s usually option <strong>17</strong>, or listed as drive).</p><h3>✅ Client ID and Secret</h3><p>Unless you’re using your own Google API credentials, just hit Enter twice:</p><ul><li>Leave client_id blank</li><li>Leave client_secret blank</li></ul><h3>✅ Scope</h3><p>This one matters: choose <strong>full access</strong> (usually option 1).<br>That gives rclone permission to read and write files.</p><h3>✅ Root Folder + Service Account</h3><p>Leave both blank unless you know you need them.</p><h3>✅ Auto config</h3><p>When rclone asks:</p><blockquote><em>Use auto config?</em></blockquote><p>Say:</p><pre>y</pre><p>At this point, it will generate a URL that looks something like this:</p><pre>http://127.0.0.1:53682/auth?state=...</pre><p>Now here’s the key:</p><p>👉 <strong>Don’t open this on your laptop yet.</strong><br>It won’t work until we tunnel the port.</p><h3>Step 2 — Create the SSH Tunnel on Your Local Machine</h3><p>Open a new terminal window on your <strong>own computer</strong> (not the server terminal).</p><p>Now run this:</p><pre>ssh -L 53682:localhost:53682 -C -N -l &lt;your_user&gt; &lt;your_remote_server_ip&gt;</pre><p>Example:</p><pre>ssh -L 53682:localhost:53682 -C -N -l root 185.10.20.30</pre><h3>Important Note:</h3><p>After you enter the password, the terminal will just “freeze” and look stuck.</p><p>That’s normal.</p><p>It’s not frozen — it’s doing its job.<br>Just leave it open.</p><h3>Step 3 — Open the Auth Link in Your Browser</h3><p>Now go back to the first terminal (the one running rclone config).</p><p>Copy the auth link rclone generated:</p><pre>http://127.0.0.1:53682/auth?state=...</pre><p>Paste it into your browser.</p><p>Because the tunnel is active, the page will load normally.</p><p>✅ Sign in<br>✅ Allow permissions<br>✅ Done</p><p>Once you approve it, rclone will automatically finish configuration.</p><h3>Step 4 — Finish Setup and Close the Tunnel</h3><p>After authorization completes, you’ll see confirmation in your rclone terminal.</p><p>Now you can:</p><p>✅ finish the last prompts<br>✅ save the config<br>✅ quit</p><p>And you can close the SSH tunnel terminal by pressing:</p><p><strong>Ctrl + C</strong></p><h3>Test If It Worked</h3><p>Run this command:</p><pre>rclone lsd gdrive:</pre><p>If you see Google Drive folders show up, congratulations — your server is now connected ✅</p><h3>Bonus Commands (Because You’ll Definitely Need These)</h3><h3>✅ Sync a folder to Drive (mirror)</h3><pre>rclone sync /path/to/folder gdrive:backup</pre><h3>✅ Copy without deleting anything</h3><pre>rclone copy /path/to/folder gdrive:backup</pre><h3>✅ Mount Drive on your server</h3><pre>rclone mount gdrive: /mnt/gdrive --daemon</pre><h3>Final Thoughts</h3><p>I’ve tried a few different ways to set up rclone on headless servers — and this SSH tunnel method is the one that just works without drama.</p><p>It’s clean, fast, and doesn’t require you to manually paste tokens or use third-party machines.</p><p>If you’re backing up data, moving files, or mounting cloud storage, rclone is honestly one of the best tools you can install on a Linux server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e767babedef0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy a PHP Site from GitHub on CloudPanel Using Dploy: Step-by-Step Guide]]></title>
            <link>https://medium.com/@itzmjunaid/how-to-deploy-a-php-site-from-github-on-cloudpanel-using-dploy-step-by-step-guide-c22f6bec9d69?source=rss-c8663592afbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/c22f6bec9d69</guid>
            <category><![CDATA[vps]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[dedicated-server]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[cloud-panel]]></category>
            <dc:creator><![CDATA[Muhammad Junaid]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 20:40:47 GMT</pubDate>
            <atom:updated>2025-12-21T20:49:50.055Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Deploy a PHP Site from GitHub on CloudPanel Using Dploy</h3><p>Deploying a PHP website can be tricky, especially when you want <strong>zero downtime</strong>, easy rollbacks, and a smooth workflow. If you are using <strong>CloudPanel</strong>, the good news is that with <strong>Dploy</strong>, deployment becomes simple, fast, and secure. In this guide, we’ll show you exactly how to set up Dploy and deploy your PHP site from <strong>GitHub</strong>, including Laravel, WordPress, or any PHP project.</p><h3>What You’ll Need</h3><p>Before we begin, make sure you have:</p><ul><li>A <strong>VPS with CloudPanel installed</strong></li><li>A <strong>site user</strong> in CloudPanel</li><li>Your PHP project hosted on <strong>GitHub</strong></li><li>SSH access to your server</li></ul><blockquote><em>Note: We will </em><strong><em>not run Dploy as root</em></strong><em> — it is always used with the site user for security.</em></blockquote><h3>Step 1: Install Dploy</h3><p>Log in as <strong>root</strong> on your server:</p><pre>ssh root@your_server_ip</pre><p>Download and install Dploy:</p><pre>curl -sS https://dploy.cloudpanel.io/dploy -o /usr/local/bin/dploy<br>echo &quot;8809e9eb63483487f16b0a2e4075a8b18350a02470405e2f786bf82fd7e5fb53 /usr/local/bin/dploy&quot; | sha256sum -c<br>chmod +x /usr/local/bin/dploy</pre><p>Verify installation:</p><pre>dploy</pre><p>You should see a list of available commands.</p><blockquote><em>⚠️ Do not run </em><em>dploy init as root — it must be used with the </em><strong><em>site user</em></strong><em>.</em></blockquote><h3>Step 2: Switch to Your Site User</h3><p>If your site user is muhammad, switch to it:</p><pre>su - muhammad</pre><p>Or log in directly via SSH:</p><pre>ssh muhammad@your_server_ip</pre><h3>Step 3: Initialize Dploy</h3><p>Run the initialization command:</p><pre>dploy init</pre><p>You will be asked for:</p><ol><li><strong>GitHub Repository SSH URL</strong><br> Example: git@github.com:yourusername/yourproject.git</li><li><strong>Deploy Directory</strong><br> Example: /home/john/htdocs/example.com</li></ol><p>Dploy will create the following folder structure:</p><pre>~/.dploy/<br> |- config.yml      # Deployment configuration<br> |- overlays/       # Environment-specific files (.env, wp-config.php, etc.)<br>/home/john/htdocs/example.com/<br> |- releases/       # All deployment releases<br> |- shared/         # Shared files between releases<br> |- current -&gt; releases/latest_release</pre><h3>Step 4: Create SSH Key for GitHub</h3><p>Navigate to the .ssh folder:</p><pre>cd ~/.ssh<br>ssh-keygen -f dploy-git -N &quot;&quot;</pre><p>Copy the public key:</p><pre>cat ~/.ssh/dploy-git.pub</pre><p>Add it as a <strong>Deploy Key</strong> in GitHub:</p><p><strong>GitHub:</strong> Settings → Deploy Keys → Add key</p><p>Paste the public key and enable write access if needed</p><p>Then configure SSH:</p><pre>nano ~/.ssh/config</pre><p>Add:</p><pre>Host github.com<br>    User git<br>    IdentityFile ~/.ssh/dploy-git</pre><p>Save and exit (Ctrl + O, Enter, Ctrl + X).</p><p>Test the connection:</p><pre>ssh -T git@github.com</pre><p>You should see:</p><pre>Hi username! You&#39;ve successfully authenticated, but GitHub does not provide shell access.</pre><h3>Step 5: Add Overlay Files</h3><p>Overlay files are environment-specific files copied into each release.</p><ul><li>Laravel: .env</li><li>WordPress: wp-config.php</li><li>Magento 2: app/etc/env.php</li></ul><p>Example for Laravel:</p><pre>cd ~/.dploy/overlays<br>nano .env</pre><p>Paste your environment variables and save.<br>Step 6: Configure config.yml</p><p>Edit the deployment configuration:</p><pre>nano ~/.dploy/config.yml</pre><p>Here’s a <strong>recommended Laravel configuration</strong>:</p><pre>project:<br>  git_repository: &#39;git@github.com:yourusername/yourproject.git&#39;<br>  deploy:<br>    directory: &#39;/home/john/htdocs/example.com&#39;<br>    shared_directories:<br>      - &#39;storage&#39;<br>      - &#39;bootstrap/cache&#39;<br>    before_commands:<br>      - &#39;find {release_directory} -type d -exec chmod 0770 {} \; &amp;&amp; find {release_directory} -type f -exec chmod 660 {} \;&#39;<br>      - &#39;cd {release_directory} &amp;&amp; php artisan config:cache&#39;<br>      - &#39;cd {release_directory} &amp;&amp; php artisan route:cache&#39;<br>    after_commands:<br>      - &#39;sudo systemctl reload php8.2-fpm&#39;<br>    keep_releases: 5</pre><p><strong>Important Notes:</strong></p><ul><li><strong>Shared directories</strong> persist between deployments (e.g., storage, cache).</li><li><strong>Before commands</strong> run before switching the release.</li><li><strong>After commands</strong> run after deployment — reloads PHP-FPM so changes take effect.</li><li>Add a <strong>sudoers rule</strong> to allow the site user to reload PHP-FPM without a password:</li></ul><pre>echo &#39;john ALL = NOPASSWD: /usr/bin/systemctl reload php*-fpm&#39; | sudo tee /etc/sudoers.d/dploy</pre><ul><li>keep_releases: 5 ensures old releases are automatically cleaned up.</li></ul><h3>Step 7: Deploy Your Site from GitHub</h3><p>Deploy a branch (like main):</p><pre>dploy deploy main</pre><p>Or deploy a tag (recommended for production):</p><pre>dploy deploy v1.0.0</pre><p>Dploy will:</p><ol><li>Clone the repository into a new timestamped folder in releases/</li><li>Copy overlay files from ~/.dploy/overlays</li><li>Link shared directories</li><li>Run before_commands</li><li>Update the current symlink to the latest release</li><li>Run after_commands (reload PHP-FPM)</li><li>Clean up old releases automatically</li></ol><h3>Step 8: Set CloudPanel Document Root</h3><p>In <strong>CloudPanel UI</strong>:</p><ul><li>Go to <strong>Sites → Your Site → Settings → Document Root</strong></li><li>For <strong>Laravel/Symfony</strong>: /home/john/htdocs/example.com/current/public</li><li>For <strong>WordPress/Other PHP apps</strong>: /home/john/htdocs/example.com/current</li></ul><blockquote><em>This ensures the web server always serves the </em><strong><em>latest release</em></strong><em>.</em></blockquote><h3>Step 9: Test Your Deployment</h3><p>Check the site in the browser — it should load the new version.</p><p>Check logs if necessary:</p><pre># Laravel logs<br>tail -f /home/john/htdocs/example.com/current/storage/logs/laravel.log</pre><h3>Step 10: Update Dploy</h3><p>To get the latest features:</p><pre>sudo dploy self-update</pre><h3>Why Use Dploy with CloudPanel and GitHub?</h3><ul><li><strong>Zero-downtime deployments</strong></li><li>Automatic handling of releases, shared files, and symlinks</li><li>Secure deployment using <strong>site user and SSH key</strong></li><li>Easy rollback to previous releases</li><li>Supports PHP, Node.js, Python, Static HTML, WordPress, Laravel, Symfony, and more</li></ul><h3>Conclusion</h3><p>Using <strong>CloudPanel + Dploy + GitHub</strong> makes deploying PHP projects fast, safe, and repeatable. With timestamped releases, shared directories, and automated commands, you can deploy Laravel, WordPress, or any PHP app confidently.</p><p>Once set up, deploying a new version is as simple as:</p><pre>dploy deploy main</pre><p>No downtime. No worries. Dploy handles the rest.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c22f6bec9d69" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>