Main issue: Logging into Shopify CLI on a remote, headless Ubuntu server fails because the OAuth callback targets localhost (127.0.0.1:3456), which isn’t accessible without a browser on the server.
Early attempts and caveats:
Using Python’s webbrowser module was suggested, but clarified as ineffective in remote SSH contexts (callback still to 127.0.0.1 on the server).
Putty/SSH local port forwarding to 3456 was used; questions arose about text-based browsers and CAPTCHA.
Working solutions:
SSH port forwarding: create a local tunnel to the server’s callback port, e.g. “ssh -L localhost:3456:localhost:3456” (optional also port 9292 for dev), enabling local browser to complete the flow.
“wget callback” method (confirmed by multiple users):
Run CLI until it shows the “Log in to Shopify Partners” URL.
Open that URL in a local browser (already logged into Partners).
I’ve installed Shopify CLI to try theme app extension. But I am working remotely from my PC to Ubuntu 18.04 dev server. When I run Shopify login, CLI gives me a URL to paste on the browser. But the redirect URI in this URL starts with 127.0.0.1. The link showed the login screen but it failed after I clicked my account.
Even I can login, I am not sure if I can scaffold a theme app extension since my app is not created with CLI.
I understand that Shopify wants to push all themes to upgrade to OS 2.0. My app is Python / Django. Now the CLI is installed with rbenv and >= Ruby 2.7. And it requires local development. Can you give me a less opinionated choice or workaround?
My app just uploads 4 liquid files to the theme. And the liquid files are using theme sections to make customizations.
Could you explain how to have the Shopify CLI open the that particular text editor? When I enter Shopify login, a text browser opens automatically in the text editor, so I can’t solve the captcha, which requires javascript. Does python’s browser solve the captcha issue?
Is it still ok to use a Tunnel in Putty? I try the same way for CLI 3.x running npm run dev. Copy the login link to the browser. Chrome tells me log in successfully. But the CLI exits on its own. Anyone is trying CLI on a remote server?
This is not correct and shouldn’t be an accepted solution. The question indicates, that they are working remotely (which probably indicates SSH tunnel). The Python webbrowser module does not help, when going to the link from remote terminal. The login page still redirects to 127.0.0.1.
Worked for me without using “-N”. If you want to ssh tunnel the dev server also just use “ssh -L localhost:3456:localhost:3456 -L localhost:9292:localhost:9292 @<server_ip>”
Chose a folder and build app: npm init @Shopify_77 [email removed]
Shopify App structure created successfully, and at this point you need to initiate a login to Shopify partner account and authenticate. Because I am creating an extension app I run: npm run shopify app generate extension
Wait for the “Auto-open timed out” message to appear after the banner: To run this command, log in to Shopify Partners.

Press any key to open the login page on your browser
Auto-open timed out. Open the login page: Log in to Shopify Partners ( http://accounts.shopify.com/oauth/authorize?client_id=.... )
7. Copy the full URL in the brackets after "Log in to Shopify Partners" text
8. Paste it in a browser on your local PC (preferably in a window already logged in to a Shopify partner account)
9. You will get a "This site can’t be reached 127.0.0.1 refused to connect." page. Copy the generated URL. It needs to have a URL starting with "http://127.0.0.1:3456/?code=...." . BTW generating the code did not work from the first time for me.
10. Open a new SSH session to your AWS EC2 instance. Paste the full URL in a wget command. Like: wget 'http://127.0.0.1:3456/?code=' . Do not forget the single quotes around the link.
11. Done. At the first SSH session screen you can see the authentication process finalizing.