Sen. Alan Cranston (D-Calif.) became the first official candidate of the 1984 presidential campaign today and vowed to make the "incredibly dangerous, shamefully expensive" nuclear arms race the overriding issue of his campaign.

With election day still more than 21 months away, Cranston announced his candidacy first in the traditional setting of the old Senate Caucus Room in Washington and then again in New Hampshire, where he appears to have put together an impressive organization.

Now in his third term in the Senate, Cranston, 68, said he is running in large part because he is convinced "that, in the long run, we cannot revive our economy--or save our society--until we end the incredibly dangerous, shamefully expensive arms race . . . .

"Our aim," Cranston said, "must be to end the threat of nuclear war, a purpose which will be the dominating goal of my presidency."

It was a theme that drew sustained applause from enthusiasts who crowded into the Cardinal Cushing Student Center at St. Anselm's College here and into the Caucus Room in Washington.

In his announcement and subsequent remarks, Cranston said he had no intention of ignoring the economy and he outlined a number of specific prescriptions for it, such as legislation directing the Federal Reserve Board to hold down interest rates. But he said he felt strongly that "a president must concentrate the powers of his mind and his office on one or two principal purposes, else he will squander his strength . . . . " The arms race, he said, has never gotten the priority attention it deserves from any president.

Cranston acknowledged that he is "older than many of the other candidates" and that he is a long shot now in the polls. But he voiced confidence that by the time the Democratic caucuses and primaries roll around next year the voters across the country will know who he is and what he stands for.

One questioner put the problem to him bluntly at a brief news conference here, asking Cranston to comment on reports that he was "trailing badly" behind former vice president Walter F. Mondale and Sen. John Glenn (D-Ohio) and that he was "not considered a 'toughie' " in the long-distance contest.

"I do not have Walter Mondale's name recognition," Cranston replied. But, he observed without a moment's hesitation, "I did not serve as vice president to Jimmy Carter." Similarly, Cranston said, "I do not have John Glenn's name recognition." But, he added, "I am not an astronaut."

Former senator John Durkin (D-N.H.), who came to listen but not to endorse, was impressed. "That takes care of the 'toughness' issue," he said.

As for his age--Cranston would be 70 before election day, 1984, and the oldest man ever inaugurated president--aides emphasized that beneath his balding head lies a very healthy senator. Cranston once set a world's record in his age group, 55 and older, for the 100-yard dash, and he sprints every morning after running a mile or two to warm up.

Cranston dealt with the issue in a different manner.

"Some have said that my age is a handicap," he said in his announcement speech. "I don't believe so. Principles and values don't decline with age. They just grow stronger."

The logistics for the day, which went smoothly from start to finish, were arranged by the Vic Kamber Group, a Washington firm that has been handling Cranston's direct mail operations, at $3,500 a month, and serving as his political consultants, at $2,000 a month, since September.

Kamber said the firm stepped in as Cranston's temporary media handler in January and will continue in that capacity for a few days. Cranston's campaign press secretary, John Russonello, formerly with Rep. Peter J. Rodino Jr. (D-N.J.), began work this week.

Cranston, who is assistant Senate minority leader, said he is counting on the organization he had put together over the past year, along with his own "message," fund-raising skills and home-state strength in populous California to establish nationwide credibility for his candidacy.

The Cranston campaign already has raised enough private seed money to qualify for a modest influx of federal matching funds starting next January and expects to come up with enough in the months ahead to mount a $25 million campaign for the Democratic nomination.

"I'm very confident about raising the money," Cranston said in an interview aboard the chartered United Airlines 727 that brought him here. "I've learned how to do it. Some candidates can never bring themselves to ask. I can and I do."

Cranston said he decided that the nation was ready for a different kind of Californian in the White House after testing the waters for more than a year through an advisory committee headed by Harris Wofford of Philadelphia and Marjorie Craig Benton of Evanston, Ill.

Cranston said he made his announcement as early as he did because "I just wanted to get going and be a full-fledged candidate." He said some people he asked for support didn't want to commit themselves until he was sure he would run.

Cranston's national campaign manager, Sergio Bendixen, a veteran of the 1972 McGovern, 1976 Carter and 1980 Kennedy campaigns, said organizational efforts are well along in Wisconsin and Washington state as well as in New Hampshire. Cranston for President committees will be announced in a few weeks in New York, Illinois and Alabama, he said.

In California, according to Kamber, 60 percent of the state's legislative and statewide elected officials will endorse Cranston Thursday "not as a favorite son, but as their candidate for president."

"We're focusing on eight states--other than California," Cranston said. Six of them--New Hampshire, Iowa, Alabama, Wisconsin, Washington and Massachusetts--will pick their delegates, about one-third of all the delegates to be chosen, in the first 2 1/2 weeks of the Democratic primary season next year. The others are New York and Illinois.