Installation of Alfresco on Windows as a service

You are here

33 posts / 0 new
Last post
Installation of Alfresco on Windows as a service

It took me quite a while to find out how to get Alfresco running as a service in Windows. The trick is to NOT start Alfresco after installation but from the start configure it as a service.

This is complete installation procedure:

Installation procedure for Alfresco on Windows 2003 server.

- MySql server (v4.1)

Run setup, you can do a default or custom installation.

After setup is finished do not start Alfresco via 'Start Alfresco Server'
in the Start menu! Also do not use the batch file to start Alfresco!

Copy \bin\imconvert.exe to C:\WINDOWS\system32

See \README_mysql.txt and configure Alfresco for use with MySql as described:
Open a command prompt and CD to \extras\databases\mysql\
Run db_setup.bat
Remove these 3 files from \tomcat\shared\classes\alfresco\extension:
- custom-db-and-data-context.xml
- custom-db-connection.properties
- custom-hibernate-dialect.properties

Configure Alfresco to be run by Tomcat as a service:

Open a command prompt and CD to \tomcat\bin
Type "set CATALINA_HOME=\tomcat"
Run "service.bat install"

Set the service to start automatically.

Add the following to the SYSTEM PATH:

Run \tomcat\bin\tomcat5w.exe
Configure the options like those in \alfresco.bat
On the Java tab:
Point the Java Virtual Machine to \java\jre\bin\client\jvm.dll
and the Java classpath to \tomcat\bin\bootstrap.jar
add the Java options:
set the memory options:
Initial memory pool: 128 Mb
Maximum memory pool: 512 Mb
Thread stack size: 64 Mb
(you can change these accoording to the amount of memory your system has)


Login to http://localhost:8080/ (user admin, password admin)

Goto the Administration Console, Manage System Users, 'Show all' and change the admin password.

If you have a firewall running, you might want to open port 8080 to give others access to Alfresco.


Thanks for the steps. There are a couple of 'gotchas': you should also copy over the win32NetBIOS.dll to somewhere in the path (for CIFS to work more easily) - or perhaps better for upgrade reasons, add \bin into the Windows PATH.

Also, this approach will not start up OpenOffice as a service, so any transformations that rely on this will not work. You can use utilities from the MS Resource Pack to create a service, but we are not permitted to redistribute this. There is a stage in the Alfresco bootstrap that can call out at start up to run any command - if you can find a way to call OpenOffice so it stays running, then this could be another solution.


Dr Paul Holmes-Higgin
Chief Product Officer

You are right. It's better to add \bin into the Windows PATH.
Then there is no need to copy the imconvert.exe file also.

Done while still using HSQLDB

Thanks for the instructions!

I was able use them as a starter and get it to work while still using HSQLDB.

1. I was able to do this even though I had previously started it manually.

2. I also did not move imconvert.exe and added %ALF_HOME%\bin to the system PATH as earlier suggested. In my case, I added C:\PROGRA~1\ALFRES~1\bin.

3. I found you do not need to add %ALF_HOME%\tomcat\bin to the PATH as it appears Tomcat does that itself.

4. I, of course, did not do any of the MySql instructions.

5. Be careful when doing the set CATALINA_HOME before running service.bat. I had to use the C:\PROGRA~1\ALFRES~1 form.

6. In addition to the other settings for tomcat5w.exe, you need to set the working path for Startup or it won't find the database. I set it to C:\PROGRA~1\ALFRES~1. This is where alfresco.bat starts so that everything is relative to it. If you don't do this, it will look for your database in C:\WINDOWS\SYSTEM32 and probably not find it there. I set the Shutdown working path as well.

7. The Java classpath and Java options were already set right for me the first time I ran tomcat5w.exe. I did set the JVM and memory options as noted though. Thread stack size is 64 Kb versus 64 Mb.

8. Not sure you really need to reboot except to check that the service starts automatically. I believe you can just Start it from Services.

Now if I can just get an OpenOffice service....

Thanks again for the boost.


As Paul mentioned earlier you could use the Windows Server 2003 Resource Kit Tools.

Use instsrv and srvany to add start_oo.bat as a service and have your Tomcat service depend on it.

I've found that to be a very easy way to get OpenOfficePortable run as a service.

Hope this helps,


Alfresco support, consulting, and training services. http://rivetlogic.com
** If this post was helpful, please click Yes on the Post Rating **


start_oo.bat isn't there in the installation. However, as noted in other postings, there is a command to substitute for it. I should be able to figure out how to make a service out of it.

I guess I'll track down the Resource Kit. I'm sure we have it, but I have not used it.

Thanks again.


There's a nice set of instructions here:




Alfresco support, consulting, and training services. http://rivetlogic.com
** If this post was helpful, please click Yes on the Post Rating **

OpenOfficePortable as service


I did it. I even downloaded the resource kit from the authoriative site.

I did not make Tomcat dependent on OpenOffice or visa versa as alfresco.bat doesn't really do that? Opinion?

Anyway, I haven't tested any transformations yet, but I did see it in the Task Manager.

Thanks again.


It's good to have the dependancy in order to be sure that OpenOfficePortable is running while Alfresco is running. That way you can ensure working transformations.



Alfresco support, consulting, and training services. http://rivetlogic.com
** If this post was helpful, please click Yes on the Post Rating **

Cannot find the CIFS when running on Windows as a server

Hi all,

I am a Mechanical Engineer and far, really far from a software engineer. Actually the only course I failed in University was Computer Programming...

So this is quite difficult for me... With that said, I am having problems (real stressful problems) which may be minor in nature I hope. First I got Alfresco 1.4 up an running after installing mysql 5. The CIFS in the Web client was showing my "bgs_a" where my computer name is "bgs". Now I could never see this in my Network Places nor could I map it cause it always kept saying that it could not connect. It is my own laptap plugged into my work LAN.

Therefore I installed as for the topic "Installation of Alfresco on Windows as a service" and it is up and running and when I add content, I hover over the file and in the status it says the location is "file////" So I cannot find the CIFS? Any idea where it is? I am really struggling with this.



I'm not exactly sure of your situation, but I will try to help....

First, the _a is just something alfresco adds to differentiate its server from the regular file server of the computer with alfresco on it.

I suggest you do a "Map Network Drive" as follows:

1. Bring up My Computer or My Documents.

2. Select Tools->Map Network Drive

3. Select the Drive you want to mount your alfresco on. It will default to Z: if you don't have that mounted already.

4. Under Folder type \\bgs_a\alfresco

5. Click different user name, enter your alfresco user name and password, and click OK.

6. I suggest you might want to click Reconnect at logon so that it will still be there next time you logon.

7. Click Finish.

Now, you should see this drive under My Computer and will be able to use it as a normal drive. The permissions on the folders and files will be as they are for you in Alfresco.

Hope this helps....


Unable to find my CIFS while running as a service

Hey Rich,

Thanks for the prompt response!

This morning I started up my laptop and I forgot that I had set it for running on windows as a service and I went to "Start Alfresco Server" then logged on and could map 'bgs_a' as you outlined. ALL worked good. When I 'hover' over the 'Open Network Folder icon it says "Open Network Folder \\bgs_a\alfresco " and down below in the status it says "file:////bgs_a/alfresco..."

Then I realized that I started it wrong cause I set it up as a service as outlined in this discussion. So I "Stopped Alfresco Server" then "started" the tomcat service from the tomcat5w.exe command, fired up firefox and logged into Alfresco and all my files are there etc... looks fine, but when I 'hover' over the 'Open Network Folder icon it says "Open Network Folder " and down below in the status it says "file://///" i.e. I do not know where the files are and I cannot map bgs_a.

Thanks in advance,

I'll think about this and post another reply if I think of anything else....

Meanwhile, I recommend that you delete or rename your manual Alfresco start and stop selections. I have done the same thing you did and this was the only way I stopped myself.

I wouldn't run the tomcat command directly. If you go Control Panel->Administrative Tools->Services, you should see an Alfresco service in the list. You can stop, restart, and start it from there. Also, you can set it to manual or automatic. In any case, even if you set it to manual, you might want to always start, stop, and restart it from there.

I would reboot your laptop and see if it works. That is if you have the service on automatic. If not, go to the Services and start it from there.

I hope this helps.

If not, we will need to go into the log to find out if we can see what is happening with CIFS.

I wish you all the best.


CIF cannot find

Hi Rich,

I do not have an "Alfresco" service but there is an "Apache Tomcat" service, which was stopped and manual. I started it and then could log onto Alfresco immediately. I changed this service to auto, rebooted and the service started but same issue with the CIF.

I have a clean machine next to me in the office. I will perform a clean install and perform op's outlined above, and will see how it works. Cause I have 'removed' and installed Alfresco about 6 times over the past few days and hopefully this may be the culprit.


Yes, the Apache Tomcat service is likely Alfresco. That is the default name.

As far as your access to CIFS, I would start checking firewall issues. Are you trying to access CIFS from a different computer or the one Alfresco is running on? If the same computer, are you trying to access as localhost, your machine name, or your machine IP address?

I don't remember what ports CIFS requires to be open. I believe you can find that from other posts in this forum though.

To start, check if your Windows firewall is turned on. If so, turn it off. TEMPORARILY! Check if CIFS works. If so, turn the firewall back on, and go searching for the right ports. Then go into the firewall and enable those.

Note, it might have nothing to do with firewall.

I wish you all the best....



I don't want to get in the way of a lively and helpful conversation, but I just wanted to check: Did you remove the custom-* files and replace them with appropriate ones for MySQL?

When CIFS appears to be offline, are you still able to login via the Web interface on http://localhost:8080/alfresco ?


Derek Hulley
Senior Software Engineer, Alfresco
http://docs.alfresco.com/ - Alfresco Docs
http://issues.alfresco.com/ - JIRA bug reporting site


Welcome! I very much appreciate you joining in.

I'll let Bradley answer, but his posts seem to indicate the web interface was working. I don't know if it is localhost though.

In regards though to the custom* files though... I remember that as a "just remove" for MySQL. Is that not correct? Just checking as I may be doing that.




Just remove is for fast-preview using MySQL. The tiny readme is not an admin guide. The Wiki page, http://wiki.alfresco.com/wiki/Repository_Configuration#New_Installations is an essential read to avoid headaches later. The 1.4 server should catch them for you, but it's better just to put it down solidly right up front.

Regarding the CIFS configuration, the alfresco.log will give more information. If we get a look at those then Gary might be able to spot something.


Derek Hulley
Senior Software Engineer, Alfresco
http://docs.alfresco.com/ - Alfresco Docs
http://issues.alfresco.com/ - JIRA bug reporting site

Thanks for the pointer to the MySQL setup information! You were right. I was just reading the readme.


It's strange that the service is no longer installed for the community version. I'm sure that 1.4 did install the service. Does the enterprise version install the service?




The service couldn't reliably start Open Office and other remote components given the wide range of platforms that the system was being installed on.

If one of our customers were to request the service, then we'd put effort into it. Usually, on production systems, they have their own mechanisms in place to ensure high availability so it's not been an issue. There are tools to make just about anything a service, so you should be able to do it yourself with little effort. There've even been some forum posts in the last few days on how to do it.


Derek Hulley
Senior Software Engineer, Alfresco
http://docs.alfresco.com/ - Alfresco Docs
http://issues.alfresco.com/ - JIRA bug reporting site

pls help me
I stiil can't install ALfresco even if a made all step from first post:((
when I try to run "service.bat install" it's finished with faild installing 'Tomcat5' service

Derek - fair enough. I'll use srvany for OO and Java Service Wrapper for Tomcat.


RivetLogic wrote:

There's a nice set of instructions here:




I've followed this instructions to put Open Office Portable in service but when I want to transform a doc file in PDF, I have the following error :

Please correct the errors below then click Finish.
* Failed to run Actions due to error: No transformation exists between mimetypes application/msword and application/pdf

If I go to the Task Manager, I can see the process OpenOfficePortable.exe. So I don't understand.

Can someone help me ?


Anyone have a solution ? I have to start Alfresco manually to do this transformation.



Sorry, but in all my wisdom I did not notice that the forum had more then 1 page, so I would always check back to this and go to the bottom of page 1 and would not notice any further converstions nor did I ever see the page 1 of 2... just found it.

Yes I did delete the 3 custom files as explained in the readme for MySql install, but for the life of me, I could never get the CIFs working. I could log in via the web client (firefox) and could do everything, but I could never map the alfresco drive _a, nor would it ever come up under windows networks. I admit defeat, and asked the IT person to "start Alfresco" whenever the server was rebooted, and in doing this the _a always appears as expected.

It seems like a "nice to have" to have it start on boot-up, but labour is cheap here in Vietnam so I will leave it to them to manually start the server.



I had the same problem while I tried 500 times to get Alfresco working properly, but I could not! I did get the same error as you, with the failed tomcat after running "service.bat install".

First check to make sure that Tomcat is not already running... (Windows) go to "start" then "control panel" then "administrative tools" then "services" make sure "Apache Tomcat" is not there and if so change to "Stopped". Then give the service.bat a-go.

Providing you have not added any documents etc. to your database, then go to one of the tomcat directories where you "installed" the database and run "db_remove" (or something like that), and then "db_install" again, and with windows, do the old regular re-boots after every stage and see what happens.

If that doesn't work, reverse back through all the steps that you did to setup as a service, remove MySql, Alfresco, reboot and re-install, and when you run "service.bat install" it will say "tomcat installed" as the last line in the batch file.

With all that said, I ended up abondoning the service cause I do not know computers that well therefore I cannot fix the problem with the CIF when I run Alfresco as a server.

Alfresco is one fantastic product. Excellent job guys/girls.


Regarding srvany and installing oo as service

What I noticed is, that though installed as a service the open office did not survive loggin off. The problem is that the service itself is still running, but the service is srvany.exe not the openofficeportable.exe. Does anyone has the solution for this problem?

OpenOfficePortable as a service

I figured out how to get OpenOfficePortable and Alfresco/Tomcat running correctly as a service.

First: Use the info provided here and elsewhere to get Tomcat running as a service.

Second: Use the srvany.exe as mentioned from the windows resource kit to get OpenOfficePortable running as a service.

Finally: The trick is to edit the service properties and make sure you set "Allow service to interact with desktop" to on for both services under the Log On tab.

Transformations now work as they did when running the whole stack from the default batch file and logged on as a user.


I found this thread through Google as I'm having this same problem.

It's pretty pathetic when I have to use some 3rd-party utility or resort to logging into the console and having to manually start Alfresco by hand.

Just goes to show the business minds of the people running that company.

Re: Installation of Alfresco on Windows as a service

as said on the start of this thread :

The trick is to NOT start Alfresco after installation but from the start configure it as a service.

And of course, I've already started Alfresco using alf_start.bat, and I'd like to avoid reinstalling it.
Is is really impossible to install the service now ?
Regards ,

RealDolmen Sud - http://sud.realdolmen.com

Re: Installation of Alfresco on Windows as a service

Re: Installation of Alfresco on Windows as a service

You have a custom-repository-context.xml? The advice you used looks old the files would be:
custom-db-and-data-context.xml -- custom-repository-context.xml
custom-db-connection.properties -- custom-repository.properties
custom-hibernate-dialect.properties -- unchanged

You can now pass just about all configuration properties to Alfresco using java -D options: http://wiki.alfresco.com/wiki/Repository_Configuration#Command_Line_Configuration_.28V2.1-A.2C_V3.1.29


Derek Hulley
Senior Software Engineer, Alfresco
http://docs.alfresco.com/ - Alfresco Docs
http://issues.alfresco.com/ - JIRA bug reporting site

forums index