“Error starting userland proxy: Bind for unexpected error Permission denied” error when debugging ASP.Net Core application

If you get an “Error starting userland proxy: Bind for unexpected error Permission denied” error, when debugging your ASP.Net Core application in Docker, then run the following command to find the excluded ports range, being used by different applications:

netsh int ip show excludedportrange protocol=tcp

image

I then change my launchSettings.json file to use a port that is not reserved

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "//localhost:50504",
      "sslPort": 44392
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Scrubber": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "//localhost:5001;//localhost:5000"
    },
    "Docker": {
      "commandName": "Docker",
      "launchBrowser": true,
      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
      "environmentVariables": {
        "ASPNETCORE_URLS": "//+:443;//+:80",
        "ASPNETCORE_HTTPS_PORT": "44393"
      },
       "httpPort": 54558,
      "useSSL": true,
      "sslPort": 44393
    }
  }
}
Continue Reading

Deploy a ASP.Net Core application to Digital Ocean

  • Make sure that your source code is checked into Github. Check in the DockerFile in the root of the repository.
  • Create a account in DockerHub at //hub.docker.com/.
    Create a new repository and connect your github repository. 
    Click Create & Build. With this, when new changes are checked into your Github repository it will be automatically build in DockerHub and a new image created.

    image

Create a new account\Login in Digital Ocean.
Create a new Droplet.

image

Select Docker and select the 5$\month plan.  Select One time password for Authentication.
Click create Droplet.

image

After the droplet is created, click the droplet.
image

Then click the console link on the right hand side.
image

In the console window, login into the your droplet using the login id and one time password, provided in email. You will be asked to change the password.
To install the application, in the console window, login into docker hub using the following command:

login docker

pull the image for your application using the following command:

docker pull ajitgoel/socialmediascrubber

To run the docker image, use the following command:

docker run –p 80:80 ajitgoel/socialmediascrubber

your website should now be visible at

//<PublicIpAddress>
Continue Reading