How to Setup SVN Server on Windows
If your working environment is Windows then you can setup Visual SVN repository just in few minutes. It’s easy to use and absolutely free for commercial projects development.
Install Visual SVN server
Download Visual SVN server installer and follow simple steps to get it installed into your system.
I would recommend to have both server and Management Console components installed.
Pay attention to your repositories location directory. Avoid long paths and spaces, use different drive if possible.
If you planning to access it form outside I would highly recommend to use secure HTTPS connection. Or you can use HTTP in case if it’s for local use only or isolated in internal LAN. If you are not sure – don’t worry, this can be reconfigured at any time after installation.
As for authentication I recommend to use Subversion build in authentication.
Create SVN user and group
Now when we have everything in place it’s time to create a user account and a repository.
Right click on Users folder in the left panel and select Create User… provide username and password and click Ok. I’ll create and account for a mysterious developer Alex. I would recommend to use lower case characters only and no special characters in usernames.
The next step is to create a group and assign Alex to it. It’s an optional step but it’s best practice to manage permissions on groups level instead of giving rights to users directly. Let’s create “developers” group.
Create new SVN repository
The next step is to create a project for Alex and grant him required permissions
Right click on Repositories element in the left panel and select Create New Repository…
It’s recommended to tick Create default structure option in order to get default SVN project structure created automatically. In case you didn’t do this you always can create trunk, branches and tags directories manually. Press Ok to complete this task.
Now it’s time to fix default access rights. Right click on Repositories and select Properties… from context menu.
As you can see by default Everyone have read/write access an all repositories. This is bad practice so we’ll fix access rights removing Everyone from the list.
Now nobody can access repositories and it’s time configure access right for our new “mega project”. Right click on your project repository and select Properties…
Add developers group with Read / Write access and confirm by pressing Ok.
The simplest way to test if everything is setup properly is to browse repository in web browser.
Select the top level element in the left panel and find Server URL in Dashboard on the right side. The server is using self signed certificate that required to be added to the browser. Normally browsers warn about such certificates and you should confirm you like to add this certificate anyway. This is how it looks like in Firefox:
Then confirm that you happy to add this certificate permanently and you’ll get a login dialog box.
Provide your username and password in order to login.
Ups… Now you are logged in but getting this message because you have no rights to browse all repositories. To fix this add your project name to the end of the URL. In my case it’s https://ruslan-pc/svn/mega-project/
Now everything works as expected and you can commit your project and start using the repository.
Now you should have your SVN repository server ready for action. However I wouldn’t recommend to use it more that for playing with configuration or learning SVN. I would highly recommend to seriously think about hosting somewhere outside your PC and the simplest (and cheapest) option is to use a hosted repository provider services. You can check the list with various subscriptions from different providers on the home page. Review it carefully, check their website and pick the option that fits for your needs.
6 Responses to “How to Setup SVN Server on Windows”
Leave a Reply
SVN and GIT HOSTING
- Is Git bet than SVN?
- Can I host several project using 1 SVN repository?
- Why pay for hosted SVN when I can setup my own?
- SVN to Git migration that works
- Setup git server on windows in few clicks
- Useful SVN options and flags tutorial
- How to Setup SVN Server on Windows